Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Problem with shared QGLWidget and contexts
VeRtEX1 last edited by
We're currently fighting the following Qt warning "QOpenGLContext::swapBuffers() called without corresponding makeCurrent() ".
We have several QGLWidgets visible at the same time. No multi-threading used. There also is an invisible QGLWidget which is used as share widget for the other OpenGL Widgets.
We are getting the warning message each frame in one of our widgets where we try to render an overlay using QPainter like this:
painter.setFont( font );
painter.setPen( Qt::NoPen );
painter.setBrush( textColor );
path.addText( textPos, font, text );
painter.drawPath( path );
We call makeCurrent() at the top of the paintGL() function. So the context should be set correctly.
Does anyone have an idea or hint on how to fix this or an answer why we are seeing this warning?
Cheers and thanks a lot! ;)
u.hertlein last edited by
Have the same issue, also with multiple shared contexts.
We're doing drawing in paintGL(), wrapped in a beginNativeRendering/endNativeRendering and overlays using after that.