28 Q_PROPERTY(QQuickParticleSystem* system READ system WRITE setSystem NOTIFY systemChanged)
29 Q_PROPERTY(QStringList groups READ groups WRITE setGroups NOTIFY groupsChanged)
31 QML_NAMED_ELEMENT(ParticlePainter)
32 QML_ADDED_IN_VERSION(2, 0)
33 QML_UNCREATABLE(
"Abstract type. Use one of the inheriting types instead.")
36 typedef QQuickParticleVarLengthArray<QQuickParticleGroupData::ID, 4> GroupIDs;
39 explicit QQuickParticlePainter(QQuickItem *parent =
nullptr);
41 void load(QQuickParticleData*);
42 void reload(QQuickParticleData*);
50 void performPendingCommits();
51 QQuickParticleSystem* system()
const
56 QStringList groups()
const
61 const GroupIDs &groupIds()
const
63 if (m_groupIdsNeedRecalculation) {
64 recalculateGroupIds();
69 void itemChange(ItemChange,
const ItemChangeData &) override;
73 void systemChanged(QQuickParticleSystem* arg);
75 void groupsChanged(
const QStringList &arg);
78 void setSystem(QQuickParticleSystem* arg);
80 void setGroups(
const QStringList &arg);
82 void calcSystemOffset(
bool resetPending =
false);
85 virtual void sceneGraphInvalidated() {}
89
90
91
94 void componentComplete() override;
95 virtual void initialize(
int gIdx,
int pIdx){
99 virtual void commit(
int gIdx,
int pIdx){
105 QQuickParticleSystem* m_system;
106 friend class QQuickParticleSystem;
109 QPointF m_systemOffset;
111 QQuickWindow *m_window;
112 bool m_windowChanged;
115 void recalculateGroupIds()
const;
118 QStringList m_groups;
119 QSet<std::pair<
int,
int> > m_pendingCommits;
120 mutable GroupIDs m_groupIds;
121 mutable bool m_groupIdsNeedRecalculation;