diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2020-10-05 21:50:35 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2020-10-09 15:13:39 +0000 |
commit | 29c833d54f93bc3443e055d2f958589f03463057 (patch) | |
tree | f8fae14c6aa49686f321b4204db7069f0649373f /share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp | |
parent | 2fe99cef9fc6b43203c65d4b753366accd7b7b51 (diff) |
QmlDesigner: Implement different render path for Qt 6
When building with Qt 6 or if qmlpuppet_unifiedRenderPath is set
in the environment we switch to a different render path.
In this case we use QQuickWindow::grabWindow() and render the root item.
No composition is done in the Qt Creator process anymore.
This is a similar approach we already take for the 3D view.
Performance is acceptable and we fix rendering issues related to
effects and layers.
Change-Id: Ic963eca047e0bf16ca3a099ec94658ae2af0fb63
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp index defbf5614a..64b6eb409c 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp @@ -33,6 +33,7 @@ #include "qt5previewnodeinstanceserver.h" #include "qt5rendernodeinstanceserver.h" #include "qt5testnodeinstanceserver.h" +#include "quickitemnodeinstance.h" #include <designersupportdelegate.h> @@ -56,7 +57,19 @@ Qt5NodeInstanceClientProxy::Qt5NodeInstanceClientProxy(QObject *parent) : NodeInstanceClientProxy(parent) { prioritizeDown(); - DesignerSupport::activateDesignerWindowManager(); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + const bool qt6 = false; +#else + const bool qt6 = true; +#endif + + const bool unifiedRenderPath = qt6 || qEnvironmentVariableIsSet("QMLPUPPET_UNIFIED_RENDER_PATH"); + + if (unifiedRenderPath) + Internal::QuickItemNodeInstance::enableUnifiedRenderPath(true); + else + DesignerSupport::activateDesignerWindowManager(); + if (QCoreApplication::arguments().at(1) == QLatin1String("--readcapturedstream")) { qputenv("DESIGNER_DONT_USE_SHARED_MEMORY", "1"); setNodeInstanceServer(std::make_unique<Qt5TestNodeInstanceServer>(this)); |