diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-01-28 10:03:27 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-28 18:15:07 +0000 |
commit | 5b641c12a58ef883985fac92e8d1fe49eeb8185f (patch) | |
tree | 16cdcf0dc8a54e58bfe694d910f130d8473c7ef3 | |
parent | 97a8372b4dfca717dc470dca2e2d5fc408aa74dc (diff) | |
download | qttools-5b641c12a58ef883985fac92e8d1fe49eeb8185f.tar.gz |
Qt Designer: Enable the QWebEngineView, QQuickWidget plugins on Windows
Switch the Graphics API to OpenGL unless another value is set.
[ChangeLog][Qt Designer] Qt Designer now sets the Graphics API to OpenGL
in order to enable the QWebEngineView and QQuickWidget plugins.
Task-number: QTBUG-94345
Task-number: QTBUG-100285
Change-Id: Iff55fe1a437191b56ed41168f243e6ec56a8648f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 89fef3e0671d6ff270e9b400f0d8696a46994453)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/designer/src/designer/main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/designer/src/designer/main.cpp b/src/designer/src/designer/main.cpp index 50c586ccc..0b3e354dd 100644 --- a/src/designer/src/designer/main.cpp +++ b/src/designer/src/designer/main.cpp @@ -29,15 +29,24 @@ #include "qdesigner.h" #include <QtCore/qlibraryinfo.h> #include <QtCore/qdir.h> +#include <QtCore/qoperatingsystemversion.h> #include <stdlib.h> QT_USE_NAMESPACE +static const char rhiBackEndVar[] = "QSG_RHI_BACKEND"; + int main(int argc, char *argv[]) { Q_INIT_RESOURCE(designer); + // Enable the QWebEngineView, QQuickWidget plugins on Windows. + if (QOperatingSystemVersion::currentType() == QOperatingSystemVersion::Windows + && !qEnvironmentVariableIsSet(rhiBackEndVar)) { + qputenv(rhiBackEndVar, "gl"); + } + // required for QWebEngineView QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); |