From 113de3584e12aebd45a2cc1d54e63a3827bf0489 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 28 Jan 2022 09:29:52 +0100 Subject: 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 (cherry picked from commit cd716a2ea2a1f0a3222dcb3cea5d4cee903def09) Reviewed-by: Qt Cherry-pick Bot --- .../plugins/qwebengineview/qwebengineview_plugin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') 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 #include +#include #include 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("\ \ \ -- cgit v1.2.3