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
qquickwander_p.h
Go to the documentation of this file.
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
4#ifndef WANDERAFFECTOR_H
5#define WANDERAFFECTOR_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#include <QHash>
19
21
30
31class Q_QUICKPARTICLES_EXPORT QQuickWanderAffector : public QQuickParticleAffector
32{
34 Q_PROPERTY(qreal pace READ pace WRITE setPace NOTIFY paceChanged)
35 Q_PROPERTY(qreal xVariance READ xVariance WRITE setXVariance NOTIFY xVarianceChanged)
36 Q_PROPERTY(qreal yVariance READ yVariance WRITE setYVariance NOTIFY yVarianceChanged)
37 Q_PROPERTY(AffectableParameters affectedParameter READ affectedParameter WRITE setAffectedParameter NOTIFY affectedParameterChanged)
38 QML_NAMED_ELEMENT(Wander)
40
41public:
45 Acceleration
46 };
47 Q_ENUM(AffectableParameters)
48
49 explicit QQuickWanderAffector(QQuickItem *parent = nullptr);
51// virtual void reset(int systemIdx);
52
54 {
55 return m_xVariance;
56 }
57
59 {
60 return m_yVariance;
61 }
62
63 qreal pace() const
64 {
65 return m_pace;
66 }
67
69 {
70 return m_affectedParameter;
71 }
72
73protected:
74 bool affectParticle(QQuickParticleData *d, qreal dt) override;
75
77
79
81
83
84
86
87public Q_SLOTS:
89{
90 if (m_xVariance != arg) {
91 m_xVariance = arg;
92 Q_EMIT xVarianceChanged(arg);
93 }
94}
95
97{
98 if (m_yVariance != arg) {
99 m_yVariance = arg;
100 Q_EMIT yVarianceChanged(arg);
101 }
102}
103
105{
106 if (m_pace != arg) {
107 m_pace = arg;
108 Q_EMIT paceChanged(arg);
109 }
110}
111
112
114{
115 if (m_affectedParameter != arg) {
116 m_affectedParameter = arg;
117 Q_EMIT affectedParameterChanged(arg);
118 }
119}
120
121private:
122 WanderData* getData(int idx);
123 QHash<int, WanderData*> m_wanderData;
124 qreal m_xVariance;
125 qreal m_yVariance;
126 qreal m_pace;
127 AffectableParameters m_affectedParameter;
128};
129
131#endif // WANDERAFFECTOR_H
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
void setXVariance(qreal arg)
void yVarianceChanged(qreal arg)
void xVarianceChanged(qreal arg)
void affectedParameterChanged(AffectableParameters arg)
void setAffectedParameter(AffectableParameters arg)
qreal yVariance() const
void paceChanged(qreal arg)
AffectableParameters affectedParameter() const
qreal xVariance() const
void setPace(qreal arg)
void setYVariance(qreal arg)
Combined button and popup list for selecting options.
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
SSL_CTX int void * arg
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_EMIT
#define Q_SLOTS
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
static QByteArray getData(int cf, IDataObject *pDataObj, int lindex=-1)