PDA

View Full Version : QGLWidget inside QGraphicsScene/View



h123
9th January 2009, 15:44
hi,
what are the different ways a QGLWidget can be put into QGraphicsScene/View ?

it would be better if you can provide code snippet.

thank you.

wysota
9th January 2009, 19:10
Basically you can make it a viewport of graphics view. As far as I remember using QGraphicsProxyWidget with a GL widget doesn't work, so that one is off.

h123
10th January 2009, 03:42
Hi wysota,

1) ok, after making viewport, where should i put OpenGL calls, e.g. in drawBackground() method or ther are other posibilities ???

2) can I connect (draw a line between) a QGLWidget's graphics primitive with QGraphicsItem or widget ? how? Like that is avaliable ni vtk demo.

Thank you.

wysota
10th January 2009, 08:46
1) ok, after making viewport, where should i put OpenGL calls, e.g. in drawBackground() method or ther are other posibilities ???
Wherever you want - drawBackgound(), drawForeground() or in the items themselves.


2) can I connect (draw a line between) a QGLWidget's graphics primitive with QGraphicsItem or widget ? how?

Yes, I don't see a problem. Make that GL primitive an item as well.