1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | #ifndef QQuickPARTICLEGROUP |
4 | #define QQuickPARTICLEGROUP |
5 | |
6 | // |
7 | // W A R N I N G |
8 | // ------------- |
9 | // |
10 | // This file is not part of the Qt API. It exists purely as an |
11 | // implementation detail. This header file may change from version to |
12 | // version without notice, or even be removed. |
13 | // |
14 | // We mean it. |
15 | // |
16 | #include <private/qquickspriteengine_p.h> |
17 | #include "qquickparticlesystem_p.h" |
18 | #include "qqmlparserstatus.h" |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | class Q_QUICKPARTICLES_PRIVATE_EXPORT QQuickParticleGroup : public QQuickStochasticState, |
23 | public QQmlParserStatus |
24 | { |
25 | Q_OBJECT |
26 | Q_PROPERTY(QQuickParticleSystem* system READ system WRITE setSystem NOTIFY systemChanged FINAL) |
27 | |
28 | //Intercept children requests and assign to the group & system |
29 | Q_PROPERTY(QQmlListProperty<QObject> particleChildren READ particleChildren DESIGNABLE false)//### Hidden property for in-state system definitions - ought not to be used in actual "Sprite" states |
30 | Q_CLASSINFO("DefaultProperty", "particleChildren") |
31 | QML_NAMED_ELEMENT(ParticleGroup) |
32 | QML_ADDED_IN_VERSION(2, 0) |
33 | Q_INTERFACES(QQmlParserStatus) |
34 | |
35 | public: |
36 | explicit QQuickParticleGroup(QObject *parent = nullptr); |
37 | |
38 | QQmlListProperty<QObject> particleChildren(); |
39 | |
40 | QQuickParticleSystem* system() const |
41 | { |
42 | return m_system; |
43 | } |
44 | |
45 | public Q_SLOTS: |
46 | |
47 | void setSystem(QQuickParticleSystem* arg); |
48 | |
49 | void delayRedirect(QObject* obj); |
50 | |
51 | Q_SIGNALS: |
52 | |
53 | void systemChanged(QQuickParticleSystem* arg); |
54 | |
55 | protected: |
56 | void componentComplete() override; |
57 | void classBegin() override {} |
58 | |
59 | private: |
60 | |
61 | void performDelayedRedirects(); |
62 | |
63 | QQuickParticleSystem* m_system; |
64 | QList<QObject*> m_delayedRedirects; |
65 | }; |
66 | |
67 | QT_END_NAMESPACE |
68 | |
69 | #endif |
70 |