View Full Version : QGraphicsScene and QGLWidget issues (VBO)

17th April 2014, 11:31
Hi guys,

I have a graphicsscene with QGLWidget as viewport.
Drawing GL scene in drawBackground.

Yet I have several QDialogs on top, added to the scene, so I have transparency over GL scene.

Now when I zoom in GL scene, I'd like to have it also drawn as a small preview in the corner.

It's working fine. GL scene that is drawn in scene background uses VBO, and preview uses glBegin/glEnd.

Yet I'd like to optimize drawing for preview. Tried to use the same gl helper class (create buffer and load it into GL memory as VBO), but I keep getting SIGSEGV after first mapping of empty buffer after glDrawArrays (glBindBuffer(xxx, 0)).

Created another object of gl helper class, but I still get SIGSEGV, not when I call glDrawArrays for the second time.

I assume the issue is that both scene and glwidget use the same gl context... is that correct?

Should I use different context to be able to use VBO in graphicsscene and glwidget? Will I have to call makeCurrent() every time before drawing?
Or what should be the approach here?

17th April 2014, 13:17
Can you show a minimal compilable example reproducing the problem?