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
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
4#ifndef QQUICKITEMANIMATION_H
5#define QQUICKITEMANIMATION_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 "qquickitem.h"
19
20#include <QtQuick/private/qquickanimation_p.h>
21
23
25class Q_QUICK_EXPORT QQuickParentAnimation : public QQuickAnimationGroup
26{
28 Q_DECLARE_PRIVATE(QQuickParentAnimation)
29
30 Q_PROPERTY(QQuickItem *target READ target WRITE setTargetObject NOTIFY targetChanged)
31 Q_PROPERTY(QQuickItem *newParent READ newParent WRITE setNewParent NOTIFY newParentChanged)
32 Q_PROPERTY(QQuickItem *via READ via WRITE setVia NOTIFY viaChanged)
33 QML_NAMED_ELEMENT(ParentAnimation)
35
36public:
37 QQuickParentAnimation(QObject *parent=nullptr);
38
39 QQuickItem *target() const;
40 void setTargetObject(QQuickItem *);
41
42 QQuickItem *newParent() const;
43 void setNewParent(QQuickItem *);
44
45 QQuickItem *via() const;
46 void setVia(QQuickItem *);
47
49 void targetChanged();
50 void newParentChanged();
51 void viaChanged();
52
53protected:
54 QAbstractAnimationJob* transition(QQuickStateActions &actions,
55 QQmlProperties &modified,
57 QObject *defaultTarget = nullptr) override;
58};
59
62{
64 Q_DECLARE_PRIVATE(QQuickAnchorAnimation)
65 Q_PROPERTY(QQmlListProperty<QQuickItem> targets READ targets)
66 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
67 Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
68 QML_NAMED_ELEMENT(AnchorAnimation)
70
71public:
72 QQuickAnchorAnimation(QObject *parent=nullptr);
73
75
76 int duration() const;
77 void setDuration(int);
78
79 QEasingCurve easing() const;
80 void setEasing(const QEasingCurve &);
81
83 void durationChanged(int);
84 void easingChanged(const QEasingCurve&);
85
86protected:
87 QAbstractAnimationJob* transition(QQuickStateActions &actions,
88 QQmlProperties &modified,
90 QObject *defaultTarget = nullptr) override;
91};
92
93#if QT_CONFIG(quick_path)
94
95class QQuickItem;
96class QQuickPath;
97class QQuickPathAnimationPrivate;
98class Q_QUICK_EXPORT QQuickPathAnimation : public QQuickAbstractAnimation
99{
101 Q_DISABLE_COPY_MOVE(QQuickPathAnimation)
102 Q_DECLARE_PRIVATE(QQuickPathAnimation)
103
104 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
105 Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
106 Q_PROPERTY(QQuickPath *path READ path WRITE setPath NOTIFY pathChanged)
107 Q_PROPERTY(QQuickItem *target READ target WRITE setTargetObject NOTIFY targetChanged)
108 Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
109 Q_PROPERTY(QPointF anchorPoint READ anchorPoint WRITE setAnchorPoint NOTIFY anchorPointChanged)
110 Q_PROPERTY(int orientationEntryDuration READ orientationEntryDuration WRITE setOrientationEntryDuration NOTIFY orientationEntryDurationChanged)
111 Q_PROPERTY(int orientationExitDuration READ orientationExitDuration WRITE setOrientationExitDuration NOTIFY orientationExitDurationChanged)
112 Q_PROPERTY(qreal endRotation READ endRotation WRITE setEndRotation NOTIFY endRotationChanged)
113 QML_NAMED_ELEMENT(PathAnimation)
115
116public:
117 QQuickPathAnimation(QObject *parent=nullptr);
118 virtual ~QQuickPathAnimation();
119
120 enum Orientation {
121 Fixed,
122 RightFirst,
123 LeftFirst,
124 BottomFirst,
125 TopFirst
126 };
127 Q_ENUM(Orientation)
128
129 int duration() const;
130 void setDuration(int);
131
132 QEasingCurve easing() const;
133 void setEasing(const QEasingCurve &);
134
135 QQuickPath *path() const;
136 void setPath(QQuickPath *);
137
138 QQuickItem *target() const;
139 void setTargetObject(QQuickItem *);
140
141 Orientation orientation() const;
142 void setOrientation(Orientation orientation);
143
144 QPointF anchorPoint() const;
145 void setAnchorPoint(const QPointF &point);
146
147 int orientationEntryDuration() const;
148 void setOrientationEntryDuration(int);
149
150 int orientationExitDuration() const;
151 void setOrientationExitDuration(int);
152
153 qreal endRotation() const;
154 void setEndRotation(qreal);
155
156protected:
157 QAbstractAnimationJob* transition(QQuickStateActions &actions,
158 QQmlProperties &modified,
159 TransitionDirection direction,
160 QObject *defaultTarget = nullptr) override;
162 void durationChanged(int);
163 void easingChanged(const QEasingCurve &);
164 void pathChanged();
165 void targetChanged();
166 void orientationChanged(Orientation);
167 void anchorPointChanged(const QPointF &);
168 void orientationEntryDurationChanged(qreal);
169 void orientationExitDurationChanged(qreal);
170 void endRotationChanged(qreal);
171};
172
173#endif
174
176
177#endif // QQUICKITEMANIMATION_H
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:217
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
Definition qqmllist.h:24
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
direction
Combined button and popup list for selecting options.
GLenum target
GLsizei const GLchar *const * path
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#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)