summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
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();