PDA

View Full Version : QGLWidget based drawing in QGraphicsScene or with QGraphicsView



augusbas
11th July 2012, 12:57
Hi all,

I am adding a QGlwidget to the setviewport of QGraphicsView and by passing the window id of glwidget to a 3rd party library , it draws some graphics into the QGlwidget.

Where i am also drawing some graphic items into the QGraphicsScene and to maintain layering (underlay/Overlay) of items , setzvalue() of graphics item is used.

How about the graphics drawn in the QGLWidget , can it be brought in between the graphics items as underlay or overlay? Please advise.


If not can QGLwidget can be added as a graphics item to the QGraphicsScene and can the 3rd party library can draw graphics into it ...Is it possible? So that i can maintain the layering.

Please advise ...

wysota
11th July 2012, 13:47
You can partially control the layering mechanism by reimplementing the paint event and calling drawBackground(), drawItems() and drawForeground() manually the way you like it.