PDA

View Full Version : is it possible to insert several qglwidgets into a qgraphicsview?



billconan
29th October 2009, 17:48
hello guys,

i'm writing a 3D CAD tool. the mainwindow contains 4 separate
qGLwidgets that represent the four cameras viewing from different
angles.

now i want to draw some transparent buttons on top of the 4 glwidgets,
then i found out that the button cannot be drawn properly. the reason
is here: http://qt.nokia.com/developer/faqs/faq.2008-03-04.5169407557

and this article gives a way of rendering transparent windows on top
of opengl: http://doc.trolltech.com/qq/qq26-openglcanvas.html

but my case is more complex. i need to render transparent windows on
top of several qglwidgets (not only one). i tried the same technique,
inserted several qglwidgets into a graphics scene, and i saw a white
screen, nothing is drawn. however, if i disable the function call
"makeCurrent();" within the qglwidget class, at least the widgets are
drawn, but the opengl content inside the qglwidget is still missing.

so i bet, this is a context switching problem. because the
graphicsview uses opengl, it has its own context, and this context
conflicts with other contexts of the qglwidgets.

but what should i do now? is there any example of using qglwidget
inside graphicsview?

thanks.

billconan
29th October 2009, 20:45
here is a screen shot of what i want to do. i want to render few transparent buttons on top of several qglwidgets.

axeljaeger
30th October 2009, 07:34
You cant embedd QGLWidgets into a QGraphicsScene. But see http://qt.nokia.com/doc/qq/qq26-openglcanvas.html

billconan
30th October 2009, 21:36
thank you.

but like i said, i need to render several opengl windows inside the graphicsview. things are more complex in my case.