summaryrefslogtreecommitdiffstats
path: root/examples
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
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')
-rw-r--r--examples/opengl/hellowindow/hellowindow.cpp2
-rw-r--r--examples/opengl/hellowindow/hellowindow.pro2
-rw-r--r--examples/opengl/hellowindow/main.cpp6
3 files changed, 7 insertions, 3 deletions
diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp
index 2cd3f8a1d3..2903ddd743 100644
--- a/examples/opengl/hellowindow/hellowindow.cpp
+++ b/examples/opengl/hellowindow/hellowindow.cpp
@@ -62,7 +62,7 @@ HelloWindow::HelloWindow(Renderer *renderer)
, m_renderer(renderer)
{
setSurfaceType(QWindow::OpenGLSurface);
- setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
+ setWindowFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
setGeometry(QRect(10, 10, 640, 480));
diff --git a/examples/opengl/hellowindow/hellowindow.pro b/examples/opengl/hellowindow/hellowindow.pro
index 555dc83574..dc724421f5 100644
--- a/examples/opengl/hellowindow/hellowindow.pro
+++ b/examples/opengl/hellowindow/hellowindow.pro
@@ -5,7 +5,7 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
-
+QT += gui-private core-private
# Input
HEADERS += hellowindow.h
SOURCES += hellowindow.cpp main.cpp
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();