1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DPARTICLEEMITBURST_H
5#define QQUICK3DPARTICLEEMITBURST_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QObject>
19#include <QQmlEngine>
20#include <QtQml/qqmlparserstatus.h>
21#include <QtQuick3DParticles/qtquick3dparticlesglobal.h>
22#include <private/qglobal_p.h>
23
24QT_BEGIN_NAMESPACE
25
26class QQuick3DParticleEmitter;
27
28class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticleEmitBurst : public QObject, public QQmlParserStatus
29{
30 Q_OBJECT
31 Q_PROPERTY(int time READ time WRITE setTime NOTIFY timeChanged)
32 Q_PROPERTY(int amount READ amount WRITE setAmount NOTIFY amountChanged)
33 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
34
35 QML_NAMED_ELEMENT(EmitBurst3D)
36 Q_INTERFACES(QQmlParserStatus)
37 QML_ADDED_IN_VERSION(6, 2)
38
39public:
40 QQuick3DParticleEmitBurst(QObject *parent = nullptr);
41 ~QQuick3DParticleEmitBurst() override;
42
43 int time() const;
44 int amount() const;
45 int duration() const;
46
47public Q_SLOTS:
48 void setTime(int time);
49 void setAmount(int amount);
50 void setDuration(int duration);
51
52Q_SIGNALS:
53 void timeChanged();
54 void amountChanged();
55 void durationChanged();
56
57protected:
58 // From QQmlParserStatus
59 void componentComplete() override;
60 void classBegin() override {}
61
62private:
63 friend class QQuick3DParticleEmitter;
64
65 QQuick3DParticleEmitter *m_parentEmitter = nullptr;
66 int m_time = 0;
67 int m_amount = 0;
68 int m_duration = 0;
69};
70
71QT_END_NAMESPACE
72
73#endif // QQUICK3DPARTICLEEMITBURST_H
74

source code of qtquick3d/src/quick3dparticles/qquick3dparticleemitburst_p.h