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
qquickpointattractor_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 ATTRACTORAFFECTOR_H
5#define ATTRACTORAFFECTOR_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//
18
20
21class Q_QUICKPARTICLES_EXPORT QQuickAttractorAffector : public QQuickParticleAffector
22{
24 Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged)
25 Q_PROPERTY(qreal pointX READ pointX WRITE setPointX NOTIFY pointXChanged)
26 Q_PROPERTY(qreal pointY READ pointY WRITE setPointY NOTIFY pointYChanged)
27 Q_PROPERTY(AffectableParameters affectedParameter READ affectedParameter WRITE setAffectedParameter NOTIFY affectedParameterChanged)
28 Q_PROPERTY(Proportion proportionalToDistance READ proportionalToDistance WRITE setProportionalToDistance NOTIFY proportionalToDistanceChanged)
29 QML_NAMED_ELEMENT(Attractor)
31
32public:
40 Q_ENUM(Proportion)
41
45 Acceleration
46 };
47 Q_ENUM(AffectableParameters)
48
49 explicit QQuickAttractorAffector(QQuickItem *parent = nullptr);
50
52 {
53 return m_strength;
54 }
55
56 qreal pointX() const
57 {
58 return m_x;
59 }
60
61 qreal pointY() const
62 {
63 return m_y;
64 }
65
67 {
68 return m_physics;
69 }
70
72 {
73 return m_proportionalToDistance;
74 }
75
77
79
81
83
85
87
88public Q_SLOTS:
90{
91 if (m_strength != arg) {
92 m_strength = arg;
93 Q_EMIT strengthChanged(arg);
94 }
95}
96
98{
99 if (m_x != arg) {
100 m_x = arg;
101 Q_EMIT pointXChanged(arg);
102 }
103}
104
106{
107 if (m_y != arg) {
108 m_y = arg;
109 Q_EMIT pointYChanged(arg);
110 }
111}
113{
114 if (m_physics != arg) {
115 m_physics = arg;
116 Q_EMIT affectedParameterChanged(arg);
117 }
118}
119
121{
122 if (m_proportionalToDistance != arg) {
123 m_proportionalToDistance = arg;
124 Q_EMIT proportionalToDistanceChanged(arg);
125 }
126}
127
128protected:
129 bool affectParticle(QQuickParticleData *d, qreal dt) override;
130
131private:
132qreal m_strength;
133qreal m_x;
134qreal m_y;
135AffectableParameters m_physics;
136Proportion m_proportionalToDistance;
137};
138
140#endif // ATTRACTORAFFECTOR_H
Proportion proportionalToDistance() const
void affectedParameterChanged(AffectableParameters arg)
void setAffectedParameter(AffectableParameters arg)
void strengthChanged(qreal arg)
AffectableParameters affectedParameter() const
void pointXChanged(qreal arg)
void setProportionalToDistance(Proportion arg)
void proportionalToDistanceChanged(Proportion arg)
void pointYChanged(qreal arg)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
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