PDA

View Full Version : Trouble placing QLabel on top ofQGLWidget



JimDaniel
8th October 2007, 22:43
Hi, I'm trying to place a QLabel .PNG image on top of a QGLWidget, but its giving a lot of trouble. The QLabel shows up fine, but the QGLWidget disappears. It also runs very slow, then inevitably crashes the program :eek:

Is this the correct method to place a 2D image on top of 3D? If not, how would I go about it? And lastly, please tell me its even possible in Qt!

Thanks for any help you can give!

wysota
8th October 2007, 23:48
I'd do it using OpenGL. Render a rectangle on the scene using an orthogonal view and bind the image to the rectangle as a texture. Alternatively reimplement the paint event of the widget, call the base class and then open a painter and draw the pixmap directly in the paint event. It'll be slower, but should work fine if your OpenGL implementation supports overlays.