summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/qt3d/scene3d/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/qt3d/scene3d/main.cpp b/examples/qt3d/scene3d/main.cpp
index 4d22a5b68..3df6816c6 100644
--- a/examples/qt3d/scene3d/main.cpp
+++ b/examples/qt3d/scene3d/main.cpp
@@ -69,10 +69,14 @@ int main(int argc, char **argv)
}
QGuiApplication app(argc, argv);
+ // Force OpenGL backend
+ QQuickWindow::setSceneGraphBackend(QSGRendererInterface::OpenGLRhi);
QQuickView view;
view.resize(1024, 768);
view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.setPersistentOpenGLContext(true);
+ view.setPersistentSceneGraph(true);
view.setSource(QUrl("qrc:/main.qml"));
view.show();