Search code examples
c++qtqwidget

How can set a Qwidget inside a QGraphicsWidget?


Is it possible that a QGraphicsWidget be a parent for QWidget? I have a QGraphicsItem and I want to add a QWidget inside this item, How can I set a QWidget in a QGraphicsItem or QGraphicsWidget that is a child of QGraphicsItem?


Solution

  • QGraphicsWidget is basically a QGraphicsItem for QWidgets ... it provides a layout you can use so it should be no problem at all

    use: QGraphicsScene::addWidget( QWidget * widget, Qt::WindowFlags wFlags = 0 )