From 37f5935a8985c38e4f7e227214cc3b0bffec32b0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 6 Mar 2014 11:02:48 +0100 Subject: [PATCH] tst_QGLThreads: Fix errors about makeCurrent() in different thread. QFATAL : tst_QGLThreads::textureUploadInThread() Cannot make QOpenGLContext current in a different thread QFATAL : tst_QGLThreads::painterOnPboInThread() Cannot make QOpenGLContext current in a different thread Task-number: QTBUG-28264 Change-Id: I281cf0593e01b43456410a9a53746bbb15f34f24 Reviewed-by: Laszlo Agocs --- tests/auto/opengl/qglthreads/tst_qglthreads.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp index 63c6cb658b..999761e3f0 100644 --- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp @@ -216,6 +216,11 @@ public: { m_gl = new QGLWidget(0, shareWidget); moveToThread(this); + + } + + void moveContextToThread() + { m_gl->context()->moveToThread(this); } @@ -307,6 +312,7 @@ void tst_QGLThreads::textureUploadInThread() display.show(); QVERIFY(QTest::qWaitForWindowActive(&display)); + thread.moveContextToThread(); thread.start(); while (thread.isRunning()) { @@ -630,6 +636,12 @@ class PaintThreadManager public: PaintThreadManager(int count) : numThreads(count) { + for (int i=0; i