diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp index 2cd3f8a1d35..2903ddd743a 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 555dc835746..dc724421f50 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 7d454f65a6d..4a11aa1c7a8 100644 --- a/examples/opengl/hellowindow/main.cpp +++ b/examples/opengl/hellowindow/main.cpp @@ -39,6 +39,8 @@ ****************************************************************************/ #include +#include +#include #include #include @@ -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();