Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qquicksmoothedanimation_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
QQUICKSMOOTHEDANIMATION2_P_H
6
#
define
QQUICKSMOOTHEDANIMATION2_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
19
#
include
"qquicksmoothedanimation_p.h"
20
#
include
"qquickanimation_p.h"
21
22
#
include
"qquickanimation_p_p.h"
23
24
#
include
<
private
/
qobject_p
.
h
>
25
#
include
<
QTimer
>
26
27
QT_BEGIN_NAMESPACE
28
class
QSmoothedAnimation;
29
class
QSmoothedAnimationTimer
:
public
QTimer
30
{
31
Q_OBJECT
32
public
:
33
explicit
QSmoothedAnimationTimer
(
QSmoothedAnimation
*
animation
,
QObject
*
parent
=
nullptr
);
34
~
QSmoothedAnimationTimer
();
35
public
Q_SLOTS
:
36
void
stopAnimation
();
37
private
:
38
QSmoothedAnimation *m_animation;
39
};
40
41
class
QQuickSmoothedAnimationPrivate
;
42
class
Q_AUTOTEST_EXPORT
QSmoothedAnimation
:
public
QAbstractAnimationJob
43
{
44
Q_DISABLE_COPY(QSmoothedAnimation)
45
public
:
46
QSmoothedAnimation(QQuickSmoothedAnimationPrivate * =
nullptr
);
47
48
~QSmoothedAnimation();
49
qreal to;
50
qreal velocity;
51
int
userDuration;
52
53
int
maximumEasingTime;
54
QQuickSmoothedAnimation::ReversingMode reversingMode;
55
56
qreal initialVelocity;
57
qreal trackVelocity;
58
59
QQmlProperty target;
60
61
int
duration()
const
override;
62
void
restart();
63
void
init();
64
65
void
prepareForRestart();
66
void
clearTemplate() { animationTemplate =
nullptr
; }
67
68
protected
:
69
void
updateCurrentTime(
int
) override;
70
void
updateState(QAbstractAnimationJob::State, QAbstractAnimationJob::State) override;
71
void
debugAnimation(QDebug d)
const
override;
72
73
private
:
74
qreal easeFollow(qreal);
75
qreal initialValue;
76
77
bool
invert;
78
79
int
finalDuration;
80
81
// Parameters for use in updateCurrentTime()
82
qreal a;
// Acceleration
83
qreal d;
// Deceleration
84
qreal tf;
// Total time
85
qreal tp;
// Time at which peak velocity occurs
86
qreal td;
// Time at which deceleration begins
87
qreal vp;
// Velocity at tp
88
qreal sp;
// Displacement at tp
89
qreal sd;
// Displacement at td
90
qreal vi;
// "Normalized" initialvelocity
91
qreal s;
// Total s
92
93
int
lastTime;
94
bool
skipUpdate;
95
96
bool
recalc();
97
void
delayedStop();
98
QSmoothedAnimationTimer *delayedStopTimer;
99
QQuickSmoothedAnimationPrivate *animationTemplate;
100
};
101
102
class
QQuickSmoothedAnimationPrivate
:
public
QQuickPropertyAnimationPrivate
103
{
104
Q_DECLARE_PUBLIC(QQuickSmoothedAnimation)
105
public
:
106
QQuickSmoothedAnimationPrivate
();
107
~
QQuickSmoothedAnimationPrivate
();
108
void
updateRunningAnimations
();
109
110
QSmoothedAnimation *
anim
;
111
QHash
<
QQmlProperty
,
QSmoothedAnimation
*>
activeAnimations
;
112
};
113
114
QT_END_NAMESPACE
115
116
#
endif
// QQUICKSMOOTHEDANIMATION2_P_H
QObjectData::parent
QObject * parent
Definition
qobject.h:74
QQuickSmoothedAnimationPrivate
Definition
qquicksmoothedanimation_p_p.h:103
QQuickSmoothedAnimationPrivate::activeAnimations
QHash< QQmlProperty, QSmoothedAnimation * > activeAnimations
Definition
qquicksmoothedanimation_p_p.h:111
QQuickSmoothedAnimationPrivate::anim
QSmoothedAnimation * anim
Definition
qquicksmoothedanimation_p_p.h:110
QQuickSmoothedAnimationPrivate::~QQuickSmoothedAnimationPrivate
~QQuickSmoothedAnimationPrivate()
Definition
qquicksmoothedanimation.cpp:342
QQuickSmoothedAnimationPrivate::updateRunningAnimations
void updateRunningAnimations()
Definition
qquicksmoothedanimation.cpp:351
QQuickSmoothedAnimation
Definition
qquicksmoothedanimation_p.h:29
QSmoothedAnimationTimer
Definition
qquicksmoothedanimation_p_p.h:30
QSmoothedAnimationTimer::~QSmoothedAnimationTimer
~QSmoothedAnimationTimer()
Definition
qquicksmoothedanimation.cpp:32
QSmoothedAnimation
Definition
qquicksmoothedanimation_p_p.h:43
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
DELAY_STOP_TIMER_INTERVAL
#define DELAY_STOP_TIMER_INTERVAL
Definition
qquicksmoothedanimation.cpp:20
qtdeclarative
src
quick
util
qquicksmoothedanimation_p_p.h
Generated on
for Qt by
1.18.0