From a547b820752cf81a5244651703a6e977df42c611 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sun, 25 Apr 2021 23:08:39 +0200 Subject: [PATCH] App: Set OpenGL backend using the Qt 6 API Qt 6 would emit: "Qt::AA_UseOpenGLES is no longer supported in Qt 6" Let's set the backend to OpenGL it via environment variable. Setting it via QQuickWindow::setSceneGraphBackend would add a dependency on "quick". Fixes: QTCREATORBUG-25637 Change-Id: Ice53be9440c586008dea9ab3731050a63073bab0 Reviewed-by: Alessandro Portale --- src/app/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 74f245d2c16..bc5e61c7840 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -537,9 +537,11 @@ int main(int argc, char **argv) } } -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (!qEnvironmentVariableIsSet("QT_OPENGL")) QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); +#else + qputenv("QT_QUICK_BACKEND", "opengl"); #endif if (qEnvironmentVariableIsSet("QTCREATOR_DISABLE_NATIVE_MENUBAR")