Quote:
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.
QGraphicsWidget is an extended base item that provides extra functionality over QGraphicsItem. It is similar to QWidget in many ways:
* Provides a palette, a font and a style().
* Has a defined geometry().
* Supports layouts with setLayout() and layout().
* Supports shortcuts and actions with grabShortcut() and insertAction()
Unlike QGraphicsItem, QGraphicsWidget is not an abstract class; you can create instances of a QGraphicsWidget without having to subclass it. This approach is useful for widgets that only serve the purpose of organizing child widgets into a layout.
QGraphicsWidget can be used as a base item for your own custom item if you require advanced input focus handling, e.g., tab focus and activation, or layouts.
Since QGraphicsWidget resembles QWidget and has similar API, it is easier to port a widget from QWidget to QGraphicsWidget, instead of QGraphicsItem.
Note: QWidget-based widgets can be directly embedded into a QGraphicsScene using QGraphicsProxyWidget.
- take a look at the documentation!