It’s not really an elegant solution but i think i found one.
Before setting QML file, (setSource) connect a slot to QQuickWindow::sceneGraphInitialized() signal like this :
connect(this, SIGNAL(sceneGraphInitialized()), this, SLOT(onSceneGraphInitialized()), Qt::DirectConnection);
when it hits the slot, do following :
openglContext()->blockSignals(true);
openglContext()->doneCurrent();
openglContext()->setShareContext(openGLContextToBeSharedWith);
openglContext()->setFormat(requestedFormat());
openglContext()->create();
openglContext()->makeCurrent(this);
↧