PDA

View Full Version : Semi-Transparent Widgets over OpenGL rendering



ddpro
18th August 2010, 01:07
Hi there,

I found this article on the web: http://doc.trolltech.com/qq/qq26-openglcanvas.html.
It says that with Qt 4.4 the only way to have semi-transparent widgets as overlay on OpenGL renderings is to use QGraphicsScene instead of QGLWidget.
Did that change with the latest version of Qt or is this still the only way to go?

Thanks a lot.

The Storm
18th August 2010, 13:43
Still the same. ;) Though there is nothing bad in using QGraphicsScene.

ddpro
19th August 2010, 01:56
Thank you!
So i successfully implemented an OpenGL rendered scene with a semi-transparent QDialog on top. On the dialog I have a couple of buttons, that have images on them. Those images are png files with transparent background and opaque foreground.

What I want to achieve is, that the image foreground on the buttons is 100% opaque, while the button backgrounds and the dialog itself are semi-transparent. Apparently the setWindowOpacity call for the dialog has an effect also on the child-buttons though: the opaque image foreground is also shown semi-transparent.
Is there a way to get the image foreground on the buttons 100% opaque while the rest is still semi-transparent?