diff options
Diffstat (limited to 'examples/quick/scenegraph/textureinthread/main.cpp')
-rw-r--r-- | examples/quick/scenegraph/textureinthread/main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/quick/scenegraph/textureinthread/main.cpp b/examples/quick/scenegraph/textureinthread/main.cpp index 3286055496..801f1891b9 100644 --- a/examples/quick/scenegraph/textureinthread/main.cpp +++ b/examples/quick/scenegraph/textureinthread/main.cpp @@ -42,6 +42,9 @@ #include <QGuiApplication> +#include <QtGui/private/qguiapplication_p.h> +#include <QtGui/qpa/qplatformintegration.h> + #include <QtQuick/QQuickView> #include "threadrenderer.h" @@ -50,6 +53,13 @@ int main(int argc, char **argv) { QGuiApplication app(argc, argv); + if (!QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::ThreadedOpenGL)) { + QQuickView view; + view.setSource(QUrl("qrc:///scenegraph/textureinthread/error.qml")); + view.show(); + return app.exec(); + } + qmlRegisterType<ThreadRenderer>("SceneGraphRendering", 1, 0, "Renderer"); int execReturn = 0; @@ -63,7 +73,7 @@ int main(int argc, char **argv) view.setPersistentSceneGraph(true); view.setResizeMode(QQuickView::SizeRootObjectToView); - view.setSource(QUrl("qrc:///scenegraph/textureinsgnode/main.qml")); + view.setSource(QUrl("qrc:///scenegraph/textureinthread/main.qml")); view.show(); execReturn = app.exec(); |