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
qstyleanimation_p.h
Go to the documentation of this file.
1
// Copyright (C) 2020 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
QSTYLEANIMATION_P_H
6
#
define
QSTYLEANIMATION_P_H
7
8
#
include
<
QtWidgets
/
private
/
qtwidgetsglobal_p
.
h
>
9
#
include
"qabstractanimation.h"
10
#
include
"qdatetime.h"
11
#
include
"qimage.h"
12
13
QT_REQUIRE_CONFIG
(
animation
);
14
15
QT_BEGIN_NAMESPACE
16
17
//
18
// W A R N I N G
19
// -------------
20
//
21
// This file is not part of the Qt API. It exists for the convenience of
22
// qcommonstyle.cpp. This header file may change from version to version
23
// without notice, or even be removed.
24
//
25
// We mean it.
26
//
27
28
class
Q_WIDGETS_EXPORT
QStyleAnimation
:
public
QAbstractAnimation
29
{
30
Q_OBJECT
31
32
public
:
33
QStyleAnimation(QObject *target);
34
virtual
~QStyleAnimation();
35
36
QObject *target()
const
;
37
38
int
duration()
const
override;
39
void
setDuration(
int
duration);
40
41
int
delay()
const
;
42
void
setDelay(
int
delay);
43
44
QTime startTime()
const
;
45
void
setStartTime(QTime time);
46
47
enum
FrameRate {
48
DefaultFps,
49
SixtyFps,
50
ThirtyFps,
51
TwentyFps,
52
FifteenFps
53
};
54
55
FrameRate frameRate()
const
;
56
void
setFrameRate(FrameRate fps);
57
58
void
updateTarget();
59
60
public
Q_SLOTS:
61
void
start();
62
63
protected
:
64
virtual
bool
isUpdateNeeded()
const
;
65
virtual
void
updateCurrentTime(
int
time) override;
66
67
private
:
68
int
_delay;
69
int
_duration;
70
QTime _startTime;
71
FrameRate _fps;
72
int
_skip;
73
};
74
75
class
Q_WIDGETS_EXPORT
QProgressStyleAnimation
:
public
QStyleAnimation
76
{
77
Q_OBJECT
78
79
public
:
80
QProgressStyleAnimation(
int
speed, QObject *target);
81
82
int
animationStep()
const
;
83
int
progressStep(
int
width)
const
;
84
85
int
speed()
const
;
86
void
setSpeed(
int
speed);
87
88
protected
:
89
bool
isUpdateNeeded()
const
override;
90
91
private
:
92
int
_speed;
93
mutable
int
_step;
94
};
95
96
class
Q_WIDGETS_EXPORT
QNumberStyleAnimation
:
public
QStyleAnimation
97
{
98
Q_OBJECT
99
100
public
:
101
QNumberStyleAnimation(QObject *target);
102
103
qreal startValue()
const
;
104
void
setStartValue(qreal value);
105
106
qreal endValue()
const
;
107
void
setEndValue(qreal value);
108
109
qreal currentValue()
const
;
110
111
protected
:
112
bool
isUpdateNeeded()
const
override;
113
114
private
:
115
qreal _start;
116
qreal _end;
117
mutable
qreal _prev;
118
};
119
120
class
Q_WIDGETS_EXPORT
QBlendStyleAnimation
:
public
QStyleAnimation
121
{
122
Q_OBJECT
123
124
public
:
125
enum
Type { Transition, Pulse };
126
127
QBlendStyleAnimation(Type type, QObject *target);
128
129
QImage startImage()
const
;
130
void
setStartImage(
const
QImage& image);
131
132
QImage endImage()
const
;
133
void
setEndImage(
const
QImage& image);
134
135
QImage currentImage()
const
;
136
137
protected
:
138
virtual
void
updateCurrentTime(
int
time) override;
139
140
private
:
141
Type _type;
142
QImage _start;
143
QImage _end;
144
QImage _current;
145
};
146
147
class
Q_WIDGETS_EXPORT
QScrollbarStyleAnimation
:
public
QNumberStyleAnimation
148
{
149
Q_OBJECT
150
151
public
:
152
enum
Mode { Activating, Deactivating };
153
154
QScrollbarStyleAnimation(Mode mode, QObject *target);
155
156
Mode mode()
const
;
157
158
bool
wasActive()
const
;
159
void
setActive(
bool
active);
160
161
private
slots:
162
void
updateCurrentTime(
int
time) override;
163
164
private
:
165
Mode _mode;
166
bool
_active;
167
};
168
169
QT_END_NAMESPACE
170
171
#
endif
// QSTYLEANIMATION_P_H
QBlendStyleAnimation
Definition
qstyleanimation_p.h:121
QImage
\inmodule QtGui
Definition
qimage.h:38
QNumberStyleAnimation
Definition
qstyleanimation_p.h:97
QProgressStyleAnimation
Definition
qstyleanimation_p.h:76
QScrollbarStyleAnimation
Definition
qstyleanimation_p.h:148
QStyleAnimation
Definition
qstyleanimation_p.h:29
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(animation)
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(animation)
blendedImage
static QImage blendedImage(const QImage &start, const QImage &end, float alpha)
Definition
qstyleanimation.cpp:224
ScrollBarFadeOutDelay
static const qreal ScrollBarFadeOutDelay
Definition
qstyleanimation.cpp:14
ScrollBarFadeOutDuration
static QT_BEGIN_NAMESPACE const qreal ScrollBarFadeOutDuration
Definition
qstyleanimation.cpp:13
qtbase
src
widgets
styles
qstyleanimation_p.h
Generated on
for Qt by
1.18.0