PDA

View Full Version : Render image on QLabel using openGl



vinodpaul
14th August 2012, 10:36
Hi,
Can somebody please tell me how to render an image on a QLabel with openGL.

Thanks
Vinod

yeye_olive
14th August 2012, 10:44
You cannot directly do OpenGL rendering into a QLabel. You should use QGLWidget instead.

Talei
14th August 2012, 17:57
You can either:
1. subclass QLabel override paint() event and use qpainter beginNativePainting() to paint using OpenGL, although graphics sub system should support OpenGL
2. use so called off-screen render, then You don't need QGLWidget at all, only valid QGLcontext. In that case You can use anything to generate image, including shaderes etc. Then render that to qimage/qpixmap and place that pix onto QLabel.