Quote:
It is also possible to draw 2D graphics onto a QOpenGLWidget subclass using QPainter:
- In paintGL(), instead of issuing OpenGL commands, construct a QPainter object for use on the widget.
- Draw primitives using QPainter's member functions.
- Direct OpenGL commands can still be issued. However, you must make sure these are enclosed by a call to the painter's beginNativePainting() and endNativePainting().
The order in which you do this would likely affect which graphics are "on top". You may not have to do all of the state saving / restoring.