Prevent warning when using QPainter on a QGLWidget.
authorSamuel Rødal <samuel.rodal@nokia.com>
Thu, 12 Apr 2012 07:39:24 +0000 (09:39 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 13 Apr 2012 06:33:47 +0000 (08:33 +0200)
Prevents warning "QOpenGLContext::swapBuffers() called without
corresponding makeCurrent()".

Change-Id: I7e4f94df8654f899c25b3f41cbf4d007ca293f16
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
src/opengl/qglpaintdevice.cpp

index 66a97a2..dc77c0f 100644 (file)
@@ -76,8 +76,7 @@ void QGLPaintDevice::beginPaint()
 {
     // Make sure our context is the current one:
     QGLContext *ctx = context();
-    if (ctx != QGLContext::currentContext())
-        ctx->makeCurrent();
+    ctx->makeCurrent();
 
     // Record the currently bound FBO so we can restore it again
     // in endPaint() and bind this device's FBO