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
qquickspritegoal_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 SPRITEGOALAFFECTOR_H
5#define SPRITEGOALAFFECTOR_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#include <QtQml/qqmlinfo.h>
19
21
23
24class Q_QUICKPARTICLES_EXPORT QQuickSpriteGoalAffector : public QQuickParticleAffector
25{
27 Q_PROPERTY(QString goalState READ goalState WRITE setGoalState NOTIFY goalStateChanged)
28 Q_PROPERTY(bool jump READ jump WRITE setJump NOTIFY jumpChanged)
29 Q_PROPERTY(bool systemStates READ systemStates WRITE setSystemStates NOTIFY systemStatesChanged)
30 QML_NAMED_ELEMENT(SpriteGoal)
32public:
34
35 QString goalState() const
36 {
37 return m_goalState;
38 }
39
40 bool jump() const
41 {
42 return m_jump;
43 }
44 bool systemStates() const
45 {
46 return m_systemStates;
47 }
48
49protected:
50 bool affectParticle(QQuickParticleData *d, qreal dt) override;
51
53
55
56 void jumpChanged(bool arg);
57
59
60public Q_SLOTS:
61
62void setGoalState(const QString &arg);
63
64void setJump(bool arg)
65{
66 if (m_jump != arg) {
67 m_jump = arg;
68 Q_EMIT jumpChanged(arg);
69 }
70}
71
73{
74 if (m_systemStates != arg) {
75 //TODO: GroupGoal was added (and this deprecated) Oct 4 - remove it in a few weeks.
76 qmlWarning(this) << "systemStates is deprecated and will be removed soon. Use GroupGoal instead.";
77 m_systemStates = arg;
78 Q_EMIT systemStatesChanged(arg);
79 }
80}
81
82private:
83 void updateStateIndex(QQuickStochasticEngine* e);
84 QString m_goalState;
85 int m_goalIdx;
86 QQuickStochasticEngine* m_lastEngine;
87 bool m_jump;
88 bool m_systemStates;
89
90 bool m_notUsingEngine;
91};
92
94
95#endif // SPRITEGOALAFFECTOR_H
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
void systemStatesChanged(bool arg)
void goalStateChanged(const QString &arg)
void jumpChanged(bool arg)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
static void jump(QtMsgType t, const QMessageLogContext &context, const QString &m)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
#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