aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickitemparticle_p.h
diff options
context:
space:
mode:
authorAlan Alpert <aalpert@blackberry.com>2015-01-26 11:50:11 -0800
committerAlan Alpert <aalpert@blackberry.com>2015-02-04 17:04:16 +0000
commit41db7b10e404f912ee7e7577a1fdf32996491162 (patch)
treea25321b1b8ebe2ff278e6b88a2c7c80981d8b04c /src/particles/qquickitemparticle_p.h
parent7be21bcde5afed368f191df6568dc16fac7b394a (diff)
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 <robin.burchell@viroteck.net>
Diffstat (limited to 'src/particles/qquickitemparticle_p.h')
-rw-r--r--src/particles/qquickitemparticle_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/particles/qquickitemparticle_p.h b/src/particles/qquickitemparticle_p.h
index 24c33319c9..04564e739a 100644
--- a/src/particles/qquickitemparticle_p.h
+++ b/src/particles/qquickitemparticle_p.h
@@ -88,8 +88,10 @@ protected:
virtual void initialize(int gIdx, int pIdx);
void prepareNextFrame();
private:
+ void processDeletables();
void tick(int time = 0);
QList<QQuickItem* > m_deletables;
+ QList<QQuickItem* > m_managed;
QList< QQuickParticleData* > m_loadables;
bool m_fade;