summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-01-28 09:29:52 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-01 00:38:36 +0000
commit7b150321c41cc07c9d9019cc5d43cb7b643f60f4 (patch)
treeb5a5c0d9753ff6af5cb944bff0a4f80767856281
parentc8de0a3f9cc9ad8ca6b00d2e84b6795aaef8072d (diff)
QWebEngineView Designer plugin: Fix crash on Windows when using D3D11
Disable the plugin for non-OpenGL graphics API similar to qttools/482125b15648944d18ae120644f9ffe11b327ff2 for QQuickWidget. Fixes: QTBUG-100285 Change-Id: Icea3d81c97ef043e953334b134ba632a9daa13a5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit cd716a2ea2a1f0a3222dcb3cea5d4cee903def09) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp b/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
index dff041800..b9c8252a0 100644
--- a/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
+++ b/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
@@ -43,6 +43,7 @@
#include <QtDesigner/QExtensionManager>
#include <QtCore/qplugin.h>
+#include <QtQuick/QQuickWindow>
#include <QWebEngineView>
QT_BEGIN_NAMESPACE
@@ -114,6 +115,14 @@ void QWebEngineViewPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
QString QWebEngineViewPlugin::domXml() const
{
+ const auto graphicsApi = QQuickWindow::graphicsApi();
+ if (graphicsApi != QSGRendererInterface::OpenGLRhi
+ && graphicsApi != QSGRendererInterface::Software) {
+ qWarning("Qt Designer: The QWebEngineView custom widget plugin is disabled because it requires OpenGL/Software RHI (current: %d).",
+ int(graphicsApi));
+ return {};
+ }
+
return QStringLiteral("\
<ui language=\"c++\">\
<widget class=\"QWebEngineView\" name=\"webEngineView\">\