[Interest] Custom OpenGL rendering in QWidget with compositing

Thomas Sevaldrud thomas at silentwings.no
Mon Oct 17 13:51:21 CEST 2022


Hi,

I have an ANGLE-based OpenGL renderer that is used for various target platforms. Now we need to use this in a Qt application and we can't rewrite all the OpenGL code to use the QOpenGLFunctions API.

Instead I've made a custom QWidget with Qt::WA_PaintOnScreen and WA_NativeWindow which sets up the ANGLE GL Context and renders through the paintEvent().

This works nicely enough, but now we need to add some Qt Buttons on top and then we get trouble with compositing and blending.

Is there another way of doing this, i.e doing custom rendering into a QWidget that can still be used along with other Qt Widgets? Any other way to use a QOpenGLWidget with an external OpenGL renderer?


More information about the Interest mailing list