From 5bf5ace38c3e63eb9110c69c74fbf4b66542c02e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 12 Apr 2012 09:39:24 +0200 Subject: Prevent warning when using QPainter on a QGLWidget. Prevents warning "QOpenGLContext::swapBuffers() called without corresponding makeCurrent()". Change-Id: I7e4f94df8654f899c25b3f41cbf4d007ca293f16 Reviewed-by: Gunnar Sletta --- src/opengl/qglpaintdevice.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/opengl/qglpaintdevice.cpp') diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp index 66a97a2ea5..dc77c0fbbb 100644 --- a/src/opengl/qglpaintdevice.cpp +++ b/src/opengl/qglpaintdevice.cpp @@ -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 -- cgit v1.2.3