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/qt5rendernodeinstanceserver.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/qt5rendernodeinstanceserver.cpp')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp index 08b20ccd22..fd3446f396 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp @@ -87,17 +87,27 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands() if (ancestorInstance.isValid()) m_dirtyInstanceSet.insert(ancestorInstance); } - DesignerSupport::updateDirtyNode(item); + Internal::QuickItemNodeInstance::updateDirtyNode(item); } } clearChangedPropertyList(); - if (!m_dirtyInstanceSet.isEmpty()) { - nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand(QtHelpers::toList(m_dirtyInstanceSet))); - m_dirtyInstanceSet.clear(); + if (Internal::QuickItemNodeInstance::unifiedRenderPath()) { + /* QQuickItem::grabToImage render path */ + /* TODO implement QQuickItem::grabToImage based rendering */ + /* sheduleRootItemRender(); */ + nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand({rootNodeInstance()})); + } else { + if (!m_dirtyInstanceSet.isEmpty()) { + nodeInstanceClient()->pixmapChanged( + createPixmapChangedCommand(QtHelpers::toList(m_dirtyInstanceSet))); + m_dirtyInstanceSet.clear(); + } } + m_dirtyInstanceSet.clear(); + resetAllItems(); slowDownRenderTimer(); @@ -137,6 +147,11 @@ void Qt5RenderNodeInstanceServer::createScene(const CreateSceneCommand &command) } nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand(instanceList)); + +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#else + quickView()->show(); +#endif } void Qt5RenderNodeInstanceServer::clearScene(const ClearSceneCommand &command) |