[Qt-interest] Embedding a QLineEdit in QGraphicsWidget

Frederic Tingaud tingaud at gostai.com
Fri Apr 9 09:52:34 CEST 2010


Paul Drummond a écrit :
> Hi,
>
> I have an application that models itself on the hyperui demo app so it has a
> main.cpp and a mainwindow that is a QGraphicsWidget.  The mainwindow has a
> series of pages (themselves QGraphicsWidgets).
>
> I know it's possible to add normal widgets like QLineEdit to a
> QGraphicsScene by using QGraphicsScene.addWidget() but I want to add my
> QLineEdit to one of my pages which are QGraphicsWidgets.  I have tried using
> QGraphicsWidget()->scene()->addWidget(lineEdit) but the app just crashes.
>
> Is is possible to add a normal QWidget to a scene as a child of a
> QGraphicsWidget?
>
> Thanks,
> Paul Drummond
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   

Yes, you need to use QGraphicsProxyWidget for this.

-- 
-------------------------------------------------------------------------------
Frederic TINGAUD

-------------------------------------------------------------------------------




More information about the Qt-interest-old mailing list