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_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 QQUICKANIMATION_P_H
6#define QQUICKANIMATION_P_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
20
21#if QT_CONFIG(quick_path)
22#include <private/qquickpath_p.h>
23#endif
24#include <private/qquickanimation_p_p.h>
25
27
29{
30 Q_DECLARE_PUBLIC(QQuickParentAnimation)
31public:
34
36 QQuickItem *newParent;
37 QQuickItem *via;
38
39 QPointF computeTransformOrigin(QQuickItem::TransformOrigin origin, qreal width, qreal height) const;
40};
41
53
54#if QT_CONFIG(quick_path)
55
56class QQuickPathAnimationUpdater : public QQuickBulkValueUpdater
57{
58public:
59 QQuickPathAnimationUpdater() : path(nullptr), pathLength(0), target(nullptr), reverse(false),
60 fromIsSourced(false), fromIsDefined(false), toIsDefined(false),
61 toX(0), toY(0), currentV(0), orientation(QQuickPathAnimation::Fixed),
62 entryInterval(0), exitInterval(0) {}
63
64 void setValue(qreal v) override;
65
66 QQuickPath *path;
67
68 QPainterPath painterPath;
69 QQuickCachedBezier prevBez;
70 qreal pathLength;
71 QList<QQuickPath::AttributePoint> attributePoints;
72
73 QQuickItem *target;
74 bool reverse;
75 bool fromIsSourced;
76 bool fromIsDefined;
77 bool toIsDefined;
78 qreal toX;
79 qreal toY;
80 qreal currentV;
81 QQmlNullableValue<qreal> interruptStart;
82 //TODO: bundle below into common struct
83 QQuickPathAnimation::Orientation orientation;
84 QPointF anchorPoint;
85 qreal entryInterval;
86 qreal exitInterval;
87 QQmlNullableValue<qreal> endRotation;
88 QQmlNullableValue<qreal> startRotation;
89};
90
91class QQuickPathAnimationPrivate;
92class QQuickPathAnimationAnimator : public QQuickBulkValueAnimator
93{
94public:
95 QQuickPathAnimationAnimator(QQuickPathAnimationPrivate * = nullptr);
96 ~QQuickPathAnimationAnimator();
97
98 void clearTemplate() { animationTemplate = nullptr; }
99
100 QQuickPathAnimationUpdater *pathUpdater() const { return static_cast<QQuickPathAnimationUpdater*>(getAnimValue()); }
101private:
102 QQuickPathAnimationPrivate *animationTemplate;
103};
104
105class QQuickPathAnimationPrivate : public QQuickAbstractAnimationPrivate
106{
107 Q_DECLARE_PUBLIC(QQuickPathAnimation)
108public:
109 QQuickPathAnimationPrivate() : path(nullptr), target(nullptr),
110 orientation(QQuickPathAnimation::Fixed), entryDuration(0), exitDuration(0), duration(250) {}
111
112 QQuickPath *path;
113 QQuickItem *target;
114 QQuickPathAnimation::Orientation orientation;
115 QPointF anchorPoint;
116 qreal entryDuration;
117 qreal exitDuration;
118 QQmlNullableValue<qreal> endRotation;
119 int duration;
120 QEasingCurve easingCurve;
121 QHash<QQuickItem*, QQuickPathAnimationAnimator* > activeAnimations;
122};
123
124#endif
125
126QT_END_NAMESPACE
127
128#endif // QQUICKANIMATION_P_H
QPointF computeTransformOrigin(QQuickItem::TransformOrigin origin, qreal width, qreal height) const
QList< QQuickParentChange * > pc