OpenGL draws widgets in Qt

I am developing a Qt application that uses Cocoa on Mac and uses the PowerVR SDK to enable OpenGL ES 2.0 on Mac Desktop.

I managed to make it work, everything works fine, the problem is that when I create a widget in this window, OpenGL displays it, for example, I create a QLabel and it displays it, making the label invisible.

I tried calling the QLabel repaint () method after rendering a single OpenGL frame, but that didn't help.

Has anyone come across this or similar problem and have any suggestions?

Thanks!

+5
source share
1 answer

If you want widgets to interact with OpenGL content, you should use QOpenGLWidget . It accesses the off-screen buffer, which is then compiled with widgets.

As an alternative, you yourself must visualize the label in the texture and apply the texture to the square.

+1
source

All Articles