Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QGLWidget with child widgets
floof last edited by
I'm currently developing a 3D application with Qt's QGLWidget.
I'm having trouble getting some widgets drawn over the QGLWidget.
What I did is:
- Create a designer QMainWindow form
- Put a QWidget as central widget
- Add child widgets to the QWidget, so they are drawn above
- Promote the QWidget to my own QGLWidget subclass
But this leads to child widgets's backgrounds to not be drawn nor refreshed. What I'd like to happen is to have the child widgets drawn over GL rendering, with transparent background.
I've seen solutions using a QGraphicsView and QGraphicsScene, but they are applied programmaticaly, and I'd prefer everything to be managed through the designer.
Is there any way to get the QGLWidget children drawn over the OpenGL scene with transparent background ?
Thanks in advance for your help.
wisty last edited by
Did u resolve this problem?
r2d3 last edited by
one solution is to use the mechanics of QGraphicsScene/View to embed widgets in a scene :
Here, you have an example of doing OpenGL in the drawBackground of the Scene.
Another way is to overpaint with a QPainter over your OpenGL scene :
I think embedding directly over QWidget in a QGLWidget is problematic.