+ QRect screenGeometry = screen->availableGeometry();
+
+ QSurfaceFormat format;
+ format.setDepthBufferSize(16);
+ format.setSamples(4);
+
+ QPoint center = QPoint(screenGeometry.center().x(), screenGeometry.top() + 80);
+ QSize windowSize(400, 320);
+ int delta = 40;
+
+ Renderer rendererA(format);
+ Renderer rendererB(format, &rendererA);
+
+ QThread renderThread;
+ rendererB.moveToThread(&renderThread);
+ renderThread.start();
+
+ QObject::connect(qGuiApp, SIGNAL(lastWindowClosed()), &renderThread, SLOT(quit()));
+
+ HelloWindow windowA(&rendererA);
+ windowA.setGeometry(QRect(center, windowSize).translated(-windowSize.width() - delta / 2, 0));
+ windowA.setWindowTitle(QLatin1String("Thread A - Context A"));