Hi Guys,
I have the following code.
QQmlEngine engine;
QQmlComponent component(&engine);
component.loadUrl(QUrl("qrc:/qml/main.qml"));
if ( !component.isReady() ) {
qWarning("%s", qPrintable(component.errorString()));
return -1;
}
QObject *topLevel = component.create();
EditorWindow *window = qobject_cast<EditorWindow *>(topLevel);
if ( !window ) {
qWarning("Error: Your root item has to be a Window.");
return -1;
}
window->show();
How do I set the context of the QWindow to a custom QOpenGLContext?
I tried to Extend QWindow via EditorWindow
but I get the error Your root item has to be a Window.
I have seen this but cant quite implement it.
http://qt-project.org/forums/viewthread/25268/
↧