From 41db7b10e404f912ee7e7577a1fdf32996491162 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 26 Jan 2015 11:50:11 -0800 Subject: QQuickItemParticle: Only delete owned particles A common pattern for ItemParticle (as shown in the particleview.qml example) is to use it to manage movement of a model's delegates. In such a case item management is handled by the user code (which bridges the needs of the Model and the View) and deleting the items in ItemParticle quickly leads to crashes. This change maintains (and improves, due to handling resets) the deletion of delegates created by the ItemParticles, as shown in delegates.qml. This example was expanded with a click to reset feature so as to more clearly see the impact of resets. Task-number: QTBUG-37486 Change-Id: I9de935034c11a7dd2abdd60e7b3bd42867dede9c Reviewed-by: Robin Burchell --- examples/quick/particles/itemparticle/delegates.qml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples/quick/particles/itemparticle') diff --git a/examples/quick/particles/itemparticle/delegates.qml b/examples/quick/particles/itemparticle/delegates.qml index 762a9c8e1c..56b80469c9 100644 --- a/examples/quick/particles/itemparticle/delegates.qml +++ b/examples/quick/particles/itemparticle/delegates.qml @@ -72,6 +72,10 @@ Rectangle { ParticleSystem { anchors.fill: parent id: syssy + MouseArea { + anchors.fill: parent + onClicked: syssy.running = !syssy.running + } Emitter { anchors.centerIn: parent emitRate: 1 -- cgit v1.2.3