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 <alessandro.portale@qt.io>
This commit is contained in:
Alessandro Portale
2021-04-25 23:08:39 +02:00
parent f0bdead363
commit a547b82075

View File

@@ -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")