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);
40 ~QQuickParticlePainter() override;
42 void load(QQuickParticleData*);
43 void reload(QQuickParticleData*);
51 void performPendingCommits();
52 QQuickParticleSystem* system()
const
57 QStringList groups()
const
62 const GroupIDs &groupIds()
const
64 if (m_groupIdsNeedRecalculation) {
65 recalculateGroupIds();
70 void itemChange(ItemChange,
const ItemChangeData &) override;
74 void systemChanged(QQuickParticleSystem* arg);
76 void groupsChanged(
const QStringList &arg);
79 void setSystem(QQuickParticleSystem* arg);
81 void setGroups(
const QStringList &arg);
83 void calcSystemOffset(
bool resetPending =
false);
86 virtual void sceneGraphInvalidated() {}
90
91
92
95 void componentComplete() override;
96 virtual void initialize(
int gIdx,
int pIdx){
100 virtual void commit(
int gIdx,
int pIdx){
106 QQuickParticleSystem* m_system;
107 friend class QQuickParticleSystem;
110 QPointF m_systemOffset;
112 QQuickWindow *m_window;
113 bool m_windowChanged;
116 void recalculateGroupIds()
const;
119 QStringList m_groups;
120 QSet<std::pair<
int,
int> > m_pendingCommits;
121 mutable GroupIDs m_groupIds;
122 mutable bool m_groupIdsNeedRecalculation;