c++ - How should I use a QGraphicsScene with layouts and widgets -
I am creating a display of some graphic data display in Qt4 and for me, QGraphicsScene
Make QGraphicsItem
for more
However, I wanted to add some layer of control (such as scrollbar, zoom + other button - I want to create it in a style such as Google Maps, i.e. the data will be displayed on the widget, and Widget will be shown on widgets). So I thought it might be possible to add them to the scene (possibly as a child of a QGraphicsGroupItem
, which will be shown on statistics) but I want to move them forward; When I change the size of the whole widget, then let it be sized, so I should use the QGraphicsLayout
to manage them. But at this point, I came to know that things are very complicated.
The problem is that while using QGraphicsLayout
, the following constraints are:
- By designing only
QGraphicsWidget
-
QGraphicsLayout
can only be used to manage oneQGraphicsWidget
This means that I have to create my own controls as QGraphicsWidget
s, add the top level QGraphicsWidget
in the data widget and manage the size of this top position Themselves from the National widget.
I would like to ask:
-
There will be no classic approach (i.e. use plain old widgets for all controls, and to display data Would it be better to use
QGraphicsScene
? -
Is there any advantage in using
QGraphicsScene
in this case Or simplicity ...)? -
How do I use
QGraphicsScene
to take advantage of my powers?
With QT 4.4 you can embed them in the QGraphicsScene
using classic widgets:
QWidget * widget = new QWidget; QGraphicsScene view; QGraphicsProxyWidget * Proxy = scene.addWidget (widget);
Comments
Post a Comment