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 | cafdb2dbcc1efd2744649550d62d7475d7191e4a (patch) | |
tree | a6a4d002bf885e8f813a7de60471f71ce2030ae2 | |
parent | 3ffbf3b3403651c605128ab8e1dd12fe15d338a6 (diff) |
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); |