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
qquickangledirection_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 QQuickANGLEDDIRECTION_H
5#define QQuickANGLEDDIRECTION_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 "qquickdirection_p.h"
18#include <QtQuickParticles/qtquickparticlesexports.h>
19#include <QtQml/qqml.h>
20
22
23class Q_QUICKPARTICLES_EXPORT QQuickAngleDirection : public QQuickDirection
24{
26 Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged)
27 Q_PROPERTY(qreal magnitude READ magnitude WRITE setMagnitude NOTIFY magnitudeChanged)
28 Q_PROPERTY(qreal angleVariation READ angleVariation WRITE setAngleVariation NOTIFY angleVariationChanged)
29 Q_PROPERTY(qreal magnitudeVariation READ magnitudeVariation WRITE setMagnitudeVariation NOTIFY magnitudeVariationChanged)
30 QML_NAMED_ELEMENT(AngleDirection)
32public:
33 explicit QQuickAngleDirection(QObject *parent = nullptr);
34 QPointF sample(const QPointF &from) override;
35 qreal angle() const
36 {
37 return m_angle;
38 }
39
41 {
42 return m_magnitude;
43 }
44
46 {
47 return m_angleVariation;
48 }
49
51 {
52 return m_magnitudeVariation;
53 }
54
56
58
60
62
64
65public Q_SLOTS:
67{
68 if (m_angle != arg) {
69 m_angle = arg;
70 Q_EMIT angleChanged(arg);
71 }
72}
73
75{
76 if (m_magnitude != arg) {
77 m_magnitude = arg;
78 Q_EMIT magnitudeChanged(arg);
79 }
80}
81
83{
84 if (m_angleVariation != arg) {
85 m_angleVariation = arg;
86 Q_EMIT angleVariationChanged(arg);
87 }
88}
89
91{
92 if (m_magnitudeVariation != arg) {
93 m_magnitudeVariation = arg;
94 Q_EMIT magnitudeVariationChanged(arg);
95 }
96}
97
98private:
99qreal m_angle;
100qreal m_magnitude;
101qreal m_angleVariation;
102qreal m_magnitudeVariation;
103};
104
106#endif // QQuickANGLEDDIRECTION_H
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:217
void angleChanged(qreal arg)
void magnitudeChanged(qreal arg)
void angleVariationChanged(qreal arg)
void magnitudeVariationChanged(qreal arg)
void setMagnitudeVariation(qreal arg)
void setAngleVariation(qreal arg)
Combined button and popup list for selecting options.
GLfloat angle
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
SSL_CTX int void * arg
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_EMIT
#define Q_SLOTS
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
#define explicit