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
qquickanimator_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 QQUICKANIMATOR_P_H
5#define QQUICKANIMATOR_P_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
18#include "qquickanimation_p.h"
19
21
22class QQuickItem;
23
26class Q_QUICK_EXPORT QQuickAnimator : public QQuickAbstractAnimation
27{
29 Q_DECLARE_PRIVATE(QQuickAnimator)
30 Q_PROPERTY(QQuickItem *target READ targetItem WRITE setTargetItem NOTIFY targetItemChanged)
31 Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
32 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
33 Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged)
34 Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged)
35
36 QML_NAMED_ELEMENT(Animator)
38 QML_UNCREATABLE("Animator is an abstract class")
39
40public:
41 QQuickItem *targetItem() const;
42 void setTargetItem(QQuickItem *target);
43
44 int duration() const;
45 void setDuration(int duration);
46
47 QEasingCurve easing() const;
48 void setEasing(const QEasingCurve & easing);
49
50 qreal to() const;
51 void setTo(qreal to);
52
53 qreal from() const;
54 void setFrom(qreal from);
55
56protected:
57 ThreadingModel threadingModel() const override { return RenderThread; }
58 virtual QQuickAnimatorJob *createJob() const = 0;
59 virtual QString propertyName() const = 0;
60 QAbstractAnimationJob *transition(QQuickStateActions &actions,
61 QQmlProperties &modified,
63 QObject *) override;
64
65 QQuickAnimator(QQuickAnimatorPrivate &dd, QObject *parent = nullptr);
66 QQuickAnimator(QObject *parent = nullptr);
67
70 void durationChanged(int duration);
71 void easingChanged(const QEasingCurve &curve);
72 void toChanged(qreal to);
73 void fromChanged(qreal from);
74};
75
76class Q_QUICK_EXPORT QQuickScaleAnimator : public QQuickAnimator
77{
79 QML_NAMED_ELEMENT(ScaleAnimator)
81public:
82 QQuickScaleAnimator(QObject *parent = nullptr);
83protected:
84 QQuickAnimatorJob *createJob() const override;
85 QString propertyName() const override { return QStringLiteral("scale"); }
86};
87
88class Q_QUICK_EXPORT QQuickXAnimator : public QQuickAnimator
89{
91 QML_NAMED_ELEMENT(XAnimator)
93public:
94 QQuickXAnimator(QObject *parent = nullptr);
95protected:
96 QQuickAnimatorJob *createJob() const override;
97 QString propertyName() const override { return QStringLiteral("x"); }
98};
99
100class Q_QUICK_EXPORT QQuickYAnimator : public QQuickAnimator
101{
103 QML_NAMED_ELEMENT(YAnimator)
105public:
106 QQuickYAnimator(QObject *parent = nullptr);
107protected:
108 QQuickAnimatorJob *createJob() const override;
109 QString propertyName() const override { return QStringLiteral("y"); }
110};
111
112class Q_QUICK_EXPORT QQuickOpacityAnimator : public QQuickAnimator
113{
115 QML_NAMED_ELEMENT(OpacityAnimator)
117public:
118 QQuickOpacityAnimator(QObject *parent = nullptr);
119protected:
120 QQuickAnimatorJob *createJob() const override;
121 QString propertyName() const override { return QStringLiteral("opacity"); }
122};
123
125class Q_QUICK_EXPORT QQuickRotationAnimator : public QQuickAnimator
126{
128 Q_DECLARE_PRIVATE(QQuickRotationAnimator)
129 Q_PROPERTY(RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged)
130 QML_NAMED_ELEMENT(RotationAnimator)
132
133public:
134 enum RotationDirection { Numerical, Shortest, Clockwise, Counterclockwise };
135 Q_ENUM(RotationDirection)
136
137 QQuickRotationAnimator(QObject *parent = nullptr);
138
139 void setDirection(RotationDirection dir);
140 RotationDirection direction() const;
141
144
145protected:
146 QQuickAnimatorJob *createJob() const override;
147 QString propertyName() const override { return QStringLiteral("rotation"); }
148};
149
150#if QT_CONFIG(quick_shadereffect)
151class QQuickUniformAnimatorPrivate;
152class Q_QUICK_EXPORT QQuickUniformAnimator : public QQuickAnimator
153{
155 Q_DECLARE_PRIVATE(QQuickUniformAnimator)
156 Q_PROPERTY(QString uniform READ uniform WRITE setUniform NOTIFY uniformChanged)
157 QML_NAMED_ELEMENT(UniformAnimator)
159
160public:
161 QQuickUniformAnimator(QObject *parent = nullptr);
162
163 QString uniform() const;
164 void setUniform(const QString &);
165
167 void uniformChanged(const QString &);
168
169protected:
170 QQuickAnimatorJob *createJob() const override;
171 QString propertyName() const override;
172};
173#endif
174
176
177#endif // QQUICKANIMATOR_P_H
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
void toChanged(qreal to)
virtual QString propertyName() const =0
void easingChanged(const QEasingCurve &curve)
void targetItemChanged(QQuickItem *)
void fromChanged(qreal from)
virtual QQuickAnimatorJob * createJob() const =0
void durationChanged(int duration)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
QString propertyName() const override
QString propertyName() const override
void directionChanged(RotationDirection dir)
QString propertyName() const override
QString propertyName() const override
QString propertyName() const override
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
direction
Combined button and popup list for selecting options.
GLenum target
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define QStringLiteral(str)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
QEasingCurve easing(QEasingCurve::InOutQuad)
[typedef]
animation setDuration(1000)
QString dir
[11]