Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickitemanimation_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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKITEMANIMATION_H
6#define QQUICKITEMANIMATION_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include "qquickitem.h"
20
21#include <QtQuick/private/qquickanimation_p.h>
22
24
26class Q_QUICK_EXPORT QQuickParentAnimation : public QQuickAnimationGroup
27{
28 Q_OBJECT
29 Q_DECLARE_PRIVATE(QQuickParentAnimation)
30
31 Q_PROPERTY(QQuickItem *target READ target WRITE setTargetObject NOTIFY targetChanged)
32 Q_PROPERTY(QQuickItem *newParent READ newParent WRITE setNewParent NOTIFY newParentChanged)
33 Q_PROPERTY(QQuickItem *via READ via WRITE setVia NOTIFY viaChanged)
34 QML_NAMED_ELEMENT(ParentAnimation)
35 QML_ADDED_IN_VERSION(2, 0)
36
37public:
38 QQuickParentAnimation(QObject *parent=nullptr);
39
40 QQuickItem *target() const;
41 void setTargetObject(QQuickItem *);
42
43 QQuickItem *newParent() const;
44 void setNewParent(QQuickItem *);
45
46 QQuickItem *via() const;
47 void setVia(QQuickItem *);
48
49Q_SIGNALS:
50 void targetChanged();
51 void newParentChanged();
52 void viaChanged();
53
54protected:
55 QAbstractAnimationJob* transition(QQuickStateActions &actions,
56 QQmlProperties &modified,
57 TransitionDirection direction,
58 QObject *defaultTarget = nullptr) override;
59};
60
62class Q_QUICK_EXPORT QQuickAnchorAnimation : public QQuickAbstractAnimation
63{
64 Q_OBJECT
65 Q_DECLARE_PRIVATE(QQuickAnchorAnimation)
66 Q_PROPERTY(QQmlListProperty<QQuickItem> targets READ targets)
67 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
68 Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
69 QML_NAMED_ELEMENT(AnchorAnimation)
70 QML_ADDED_IN_VERSION(2, 0)
71
72public:
73 QQuickAnchorAnimation(QObject *parent=nullptr);
74
75 QQmlListProperty<QQuickItem> targets();
76
77 int duration() const;
78 void setDuration(int);
79
80 QEasingCurve easing() const;
81 void setEasing(const QEasingCurve &);
82
83Q_SIGNALS:
84 void durationChanged(int);
85 void easingChanged(const QEasingCurve&);
86
87protected:
88 QAbstractAnimationJob* transition(QQuickStateActions &actions,
89 QQmlProperties &modified,
90 TransitionDirection direction,
91 QObject *defaultTarget = nullptr) override;
92};
93
94#if QT_CONFIG(quick_path)
95
96class QQuickItem;
97class QQuickPath;
98class QQuickPathAnimationPrivate;
99class Q_QUICK_EXPORT QQuickPathAnimation : public QQuickAbstractAnimation
100{
101 Q_OBJECT
102 Q_DISABLE_COPY_MOVE(QQuickPathAnimation)
103 Q_DECLARE_PRIVATE(QQuickPathAnimation)
104
105 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
106 Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
107 Q_PROPERTY(QQuickPath *path READ path WRITE setPath NOTIFY pathChanged)
108 Q_PROPERTY(QQuickItem *target READ target WRITE setTargetObject NOTIFY targetChanged)
109 Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
110 Q_PROPERTY(QPointF anchorPoint READ anchorPoint WRITE setAnchorPoint NOTIFY anchorPointChanged)
111 Q_PROPERTY(int orientationEntryDuration READ orientationEntryDuration WRITE setOrientationEntryDuration NOTIFY orientationEntryDurationChanged)
112 Q_PROPERTY(int orientationExitDuration READ orientationExitDuration WRITE setOrientationExitDuration NOTIFY orientationExitDurationChanged)
113 Q_PROPERTY(qreal endRotation READ endRotation WRITE setEndRotation NOTIFY endRotationChanged)
114 QML_NAMED_ELEMENT(PathAnimation)
115 QML_ADDED_IN_VERSION(2, 0)
116
117public:
118 QQuickPathAnimation(QObject *parent=nullptr);
119 virtual ~QQuickPathAnimation();
120
121 enum Orientation {
122 Fixed,
123 RightFirst,
124 LeftFirst,
125 BottomFirst,
126 TopFirst
127 };
128 Q_ENUM(Orientation)
129
130 int duration() const;
131 void setDuration(int);
132
133 QEasingCurve easing() const;
134 void setEasing(const QEasingCurve &);
135
136 QQuickPath *path() const;
137 void setPath(QQuickPath *);
138
139 QQuickItem *target() const;
140 void setTargetObject(QQuickItem *);
141
142 Orientation orientation() const;
143 void setOrientation(Orientation orientation);
144
145 QPointF anchorPoint() const;
146 void setAnchorPoint(const QPointF &point);
147
148 int orientationEntryDuration() const;
149 void setOrientationEntryDuration(int);
150
151 int orientationExitDuration() const;
152 void setOrientationExitDuration(int);
153
154 qreal endRotation() const;
155 void setEndRotation(qreal);
156
157protected:
158 QAbstractAnimationJob* transition(QQuickStateActions &actions,
159 QQmlProperties &modified,
160 TransitionDirection direction,
161 QObject *defaultTarget = nullptr) override;
162Q_SIGNALS:
163 void durationChanged(int);
164 void easingChanged(const QEasingCurve &);
165 void pathChanged();
166 void targetChanged();
167 void orientationChanged(QQuickPathAnimation::Orientation);
168 void anchorPointChanged(const QPointF &);
169 void orientationEntryDurationChanged(qreal);
170 void orientationExitDurationChanged(qreal);
171 void endRotationChanged(qreal);
172};
173
174#endif
175
176QT_END_NAMESPACE
177
178#endif // QQUICKITEMANIMATION_H
QPointF computeTransformOrigin(QQuickItem::TransformOrigin origin, qreal width, qreal height) const
QList< QQuickParentChange * > pc