summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.cpp12
1 files changed, 12 insertions, 0 deletions
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<numThreads; ++i)
+ devices.append(new T);
+ // Wait until resize events are processed on the internal
+ // QGLWidgets of the buffers to suppress errors
+ // about makeCurrent() from the wrong thread.
+ QCoreApplication::processEvents();
for (int i=0; i<numThreads; ++i) {
devices.append(new T);
threads.append(new QThread);