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
qquickanimatedproperty_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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 QQUICKANIMATEDPROPERTY_P_H
5#define QQUICKANIMATEDPROPERTY_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 <QMap>
19#include <QVariant>
20#include <QtGui/private/qbezier_p.h>
22
24
25class Q_QUICKVECTORIMAGEGENERATOR_EXPORT QQuickAnimatedProperty
26{
27public:
28 struct Q_QUICKVECTORIMAGEGENERATOR_EXPORT PropertyAnimation {
29 enum Flag {
30 NoFlags = 0,
31 FreezeAtEnd = 1,
32 ReplacePreviousAnimations = 2,
33 };
34
35 QMap<int, QVariant> frames;
36 QMap<int, QBezier> easingPerFrame;
37 int subtype = 0;
38 int repeatCount = 1;
39 int startOffset = 0;
40 quint8 flags = NoFlags;
41
42 bool isConstant() const {
43 if (startOffset > 0)
44 return false;
45
46 for (const auto& frame : frames) {
47 if (frame != frames.first())
48 return false;
49 }
50 return true;
51 }
52
53 PropertyAnimation simplified() const;
54 };
55
56 QQuickAnimatedProperty(const QVariant &defaultValue)
57 : m_defaultValue(defaultValue)
58 {
59 }
60
61 bool isAnimated() const
62 {
63 return !m_animations.isEmpty();
64 }
65
66 QVariant defaultValue() const
67 {
68 return m_defaultValue;
69 }
70
71 void setDefaultValue(const QVariant &value)
72 {
73 m_defaultValue = value;
74 }
75
76 qsizetype animationCount() const
77 {
78 return m_animations.size();
79 }
80
81 const PropertyAnimation &animation(int index) const
82 {
83 return m_animations.at(index);
84 }
85
86 void addAnimation(const PropertyAnimation &animation)
87 {
88 if (m_animationGroups.isEmpty())
89 beginAnimationGroup();
90
91 m_animations.append(animation.simplified());
92 }
93
94 qsizetype animationGroupCount() const
95 {
96 return m_animationGroups.size();
97 }
98
99 int animationGroup(int index) const
100 {
101 return m_animationGroups.at(index);
102 }
103
104 void beginAnimationGroup()
105 {
106 m_animationGroups.append(m_animations.size());
107 }
108
109private:
110 QVariant m_defaultValue;
111 QList<PropertyAnimation> m_animations;
112 QList<int> m_animationGroups;
113};
114
115QT_END_NAMESPACE
116
117#endif // QQUICKANIMATEDPROPERTY_P_H
bool visitFilterNodeStart(const QSvgFilterContainer *node) override
void visitPolygonNode(const QSvgPolygon *node) override
bool visitSwitchNodeStart(const QSvgSwitch *node) override
void visitMaskNodeEnd(const QSvgMask *node) override
void visitEllipseNode(const QSvgEllipse *node) override
void visitPathNode(const QSvgPath *node) override
void visitMarkerNodeEnd(const QSvgMarker *node) override
bool visitDefsNodeStart(const QSvgDefs *node) override
void visitDefsNodeEnd(const QSvgDefs *node) override
bool visitMaskNodeStart(const QSvgMask *node) override
void visitDocumentNodeEnd(const QSvgDocument *node) override
~QSvgVisitorImpl() override
void visitStructureNodeEnd(const QSvgStructureNode *node) override
void visitRectNode(const QSvgRect *node) override
void visitFeFilterPrimitiveNodeEnd(const QSvgFeFilterPrimitive *node) override
void visitLineNode(const QSvgLine *node) override
void visitNode(const QSvgNode *node) override
bool visitMarkerNodeStart(const QSvgMarker *node) override
void visitPolylineNode(const QSvgPolyline *node) override
QSvgVisitorImpl(const QString svgFileName, QQuickGenerator *generator, bool assumeTrustedSource)
void visitUseNode(const QSvgUse *node) override
bool visitSymbolNodeStart(const QSvgSymbol *node) override
void visitPatternNodeEnd(const QSvgPattern *) override
bool visitDocumentNodeStart(const QSvgDocument *node) override
void visitImageNode(const QSvgImage *node) override
void visitFilterNodeEnd(const QSvgFilterContainer *node) override
bool visitPatternNodeStart(const QSvgPattern *) override
void visitTextNode(const QSvgText *node) override
void visitSwitchNodeEnd(const QSvgSwitch *node) override
void visitSymbolNodeEnd(const QSvgSymbol *node) override
bool visitFeFilterPrimitiveNodeStart(const QSvgFeFilterPrimitive *node) override
bool visitStructureNodeStart(const QSvgStructureNode *node) override
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE QT_DECLARE_EXPORTED_QT_LOGGING_CATEGORY(lcAotCompiler, Q_QMLCOMPILER_EXPORT)