summaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellowindow/main.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-11-28 11:32:39 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-28 15:08:01 +0100
commit67e613963dddf2ecef7f26a4fea0c7709a211c49 (patch)
tree821a4adfb4b520956a2b22d301a73fe67ef8f465 /examples/opengl/hellowindow/main.cpp
parent45aa0a219a9fb15aad25ac5f1d4ba15752eddffb (diff)
Polish the HelloWindow example.
- Add window menu (enabling the close button on Windows) - Query threaded Open GL capability. Change-Id: I938f154e242dba584e2f597ac44294ab5d3b7141 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'examples/opengl/hellowindow/main.cpp')
-rw-r--r--examples/opengl/hellowindow/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/opengl/hellowindow/main.cpp b/examples/opengl/hellowindow/main.cpp
index 7d454f65a6..4a11aa1c7a 100644
--- a/examples/opengl/hellowindow/main.cpp
+++ b/examples/opengl/hellowindow/main.cpp
@@ -39,6 +39,8 @@
****************************************************************************/
#include <QGuiApplication>
+#include <QPlatformIntegration>
+#include <private/qguiapplication_p.h>
#include <QScreen>
#include <QThread>
@@ -48,7 +50,9 @@ int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
- bool multipleWindows = !QGuiApplication::arguments().contains(QLatin1String("--single"));
+ const bool multipleWindows =
+ QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)
+ && !QGuiApplication::arguments().contains(QLatin1String("--single"));
QScreen *screen = QGuiApplication::primaryScreen();