From c36cfe85588ad6bdcd26d1b22507310c14bb45ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20O=2E=20Cordero=20P=C3=A9rez?= Date: Thu, 21 Mar 2024 00:06:17 -0400 Subject: [PATCH] Re-add ability to switch render modes under Qt 6 Fixes #880, where QSG_VISUALIZE overdraw, and other modes, were not working under Plasma. Note, other render modes, such as Vulkan, are yet to be implemented. --- plugins/quickinspector/quickinspector.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/quickinspector/quickinspector.cpp b/plugins/quickinspector/quickinspector.cpp index f4b5a8df90..b8691215e7 100644 --- a/plugins/quickinspector/quickinspector.cpp +++ b/plugins/quickinspector/quickinspector.cpp @@ -301,15 +301,16 @@ void RenderModeRequest::apply() if (connection) disconnect(connection); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - // crashes in qrhigles2..bindShaderResources sometimes - return; -#endif - - if (window && window->rendererInterface()->graphicsApi() != QSGRendererInterface::OpenGL) - return; - if (window) { + switch (window->rendererInterface()->graphicsApi()) { + // Compatible render interfaces + case QSGRendererInterface::Software: + case QSGRendererInterface::OpenGL: + break; + default: + return; + } + emit aboutToCleanSceneGraph(); const QByteArray mode = renderModeToString(RenderModeRequest::mode); QQuickWindowPrivate *winPriv = QQuickWindowPrivate::get(window);