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:

  1. By designing only QGraphicsWidget
  2. QGraphicsLayout can only be used to manage one QGraphicsWidget

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:

  1. 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 ?

  2. Is there any advantage in using QGraphicsScene in this case Or simplicity ...)?

  3. How do I use QGraphicsScene to take advantage of my powers?

< / Div>

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

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -