Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquick3dparticleemitburst.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
6#include <qdebug.h>
7
9
47 : QObject(parent)
48{
49 m_parentEmitter = qobject_cast<QQuick3DParticleEmitter *>(parent);
50}
51
53{
54 if (m_parentEmitter)
55 m_parentEmitter->unRegisterEmitBurst(this);
56}
57
66{
67 return m_time;
68}
69
78{
79 return m_amount;
80}
81
102{
103 return m_duration;
104}
105
107{
108 if (m_time == time)
109 return;
110
111 m_time = time;
113}
114
116{
117 if (m_amount == amount)
118 return;
119 if (amount < 0) {
120 qWarning () << "EmitBurst3D: Amount must be positive.";
121 return;
122 }
123 m_amount = amount;
125}
126
128{
129 if (m_duration == duration)
130 return;
131 if (duration < 0) {
132 qWarning () << "EmitBurst3D: Duration must be positive.";
133 return;
134 }
135 m_duration = duration;
137}
138
140{
141 m_parentEmitter = qobject_cast<QQuick3DParticleEmitter *>(parent());
142 if (m_parentEmitter)
143 m_parentEmitter->registerEmitBurst(this);
144 else
145 qWarning() << "EmitBurst requires parent Emitter to function correctly!";
146}
147
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
QQuick3DParticleEmitBurst(QObject *parent=nullptr)
\qmltype EmitBurst3D \inherits QtObject \inqmlmodule QtQuick3D.Particles3D
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void registerEmitBurst(QQuick3DParticleEmitBurst *emitBurst)
void unRegisterEmitBurst(QQuick3DParticleEmitBurst *emitBurst)
Combined button and popup list for selecting options.
#define qWarning
Definition qlogging.h:166
#define Q_EMIT