From bd607909a514ac17a5d0e41ee664bf61494783b5 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 18 Mar 2022 10:19:07 +0200 Subject: [PATCH] QmlDesigner: Reset puppet when ParticleShape3D is reparented This is a workaround to QtQuick3D bug that only updates the parent node of the shape at componentComplete. Fixes: QDS-6473 Change-Id: Ice8afdc81b35eb40c07889bb1eebcdb70e68c17d Reviewed-by: Thomas Hartmann Reviewed-by: Qt CI Bot --- .../designercore/instances/nodeinstanceview.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp index a6061234320..670a6a5c4ac 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp @@ -565,9 +565,11 @@ void NodeInstanceView::nodeReparented(const ModelNode &node, const NodeAbstractP // Reset puppet when particle emitter/affector is reparented to work around issue in // autodetecting the particle system it belongs to. QTBUG-101157 - if ((node.isSubclassOf("QtQuick.Particles3D.ParticleEmitter3D") - || node.isSubclassOf("QtQuick.Particles3D.Affector3D")) - && node.property("system").toBindingProperty().expression().isEmpty()) { + // Reset is also needed when particle shapes are reparented. QTBUG-101882 + if (((node.isSubclassOf("QtQuick.Particles3D.ParticleEmitter3D") + || node.isSubclassOf("QtQuick.Particles3D.Affector3D")) + && node.property("system").toBindingProperty().expression().isEmpty()) + || node.isSubclassOf("QQuick3DParticleAbstractShape")) { resetPuppet(); } }