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 <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Miikka Heikkinen
2022-03-18 10:19:07 +02:00
parent c1b585933b
commit bd607909a5

View File

@@ -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();
}
}