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
qquickanimatedimage_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
QQUICKANIMATEDIMAGE_P_H
6
#
define
QQUICKANIMATEDIMAGE_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
<
private
/
qtquickglobal_p
.
h
>
20
21
QT_REQUIRE_CONFIG
(
quick_animatedimage
);
22
23
#
include
"qquickimage_p.h"
24
25
QT_BEGIN_NAMESPACE
26
27
class
QMovie;
28
class
QQuickAnimatedImagePrivate
;
29
30
class
Q_QUICK_EXPORT
QQuickAnimatedImage
:
public
QQuickImage
31
{
32
Q_OBJECT
33
34
Q_PROPERTY(
bool
playing READ isPlaying WRITE setPlaying NOTIFY playingChanged)
35
Q_PROPERTY(
bool
paused READ isPaused WRITE setPaused NOTIFY pausedChanged)
36
Q_PROPERTY(
int
currentFrame READ currentFrame WRITE setCurrentFrame NOTIFY frameChanged OVERRIDE)
37
Q_PROPERTY(
int
frameCount READ frameCount NOTIFY frameCountChanged OVERRIDE)
38
Q_PROPERTY(qreal speed READ speed WRITE setSpeed NOTIFY speedChanged REVISION(2, 11))
39
Q_PROPERTY(
int
loops READ loops WRITE setLoops NOTIFY loopsChanged REVISION(6, 12))
40
Q_PROPERTY(FinishBehavior finishBehavior READ finishBehavior WRITE setFinishBehavior NOTIFY
41
finishBehaviorChanged REVISION(6, 12))
42
43
QML_NAMED_ELEMENT(AnimatedImage)
44
QML_ADDED_IN_VERSION(2, 0)
45
46
public
:
47
enum
LoopParameters { Infinite = -1 };
48
Q_ENUM(LoopParameters)
49
50
enum
FinishBehavior : quint8 { FinishAtInitialFrame, FinishAtFinalFrame };
51
Q_ENUM(FinishBehavior)
52
53
QQuickAnimatedImage(QQuickItem *parent=
nullptr
);
54
~QQuickAnimatedImage();
55
56
bool
isPlaying()
const
;
57
void
setPlaying(
bool
play);
58
59
bool
isPaused()
const
;
60
void
setPaused(
bool
pause);
61
62
int
currentFrame()
const
override;
63
void
setCurrentFrame(
int
frame) override;
64
65
int
frameCount()
const
override;
66
67
qreal speed()
const
;
68
void
setSpeed(qreal speed);
69
70
// Extends QQuickImage's src property
71
void
setSource(
const
QUrl&) override;
72
73
int
loops()
const
;
74
void
setLoops(
int
loops);
75
76
FinishBehavior finishBehavior()
const
;
77
void
setFinishBehavior(FinishBehavior behavior);
78
79
Q_SIGNALS:
80
void
playingChanged();
81
void
pausedChanged();
82
void
frameChanged();
83
void
currentFrameChanged();
84
void
frameCountChanged();
85
Q_REVISION(2, 11)
void
speedChanged();
86
Q_REVISION(6, 12)
void
loopsChanged();
87
Q_REVISION(6, 12)
void
finishBehaviorChanged();
88
Q_REVISION(6, 12)
void
finished();
89
90
private
Q_SLOTS:
91
void
movieUpdate();
92
void
movieRequestFinished();
93
void
playingStatusChanged();
94
void
onCacheChanged();
95
Q_REVISION(6, 12)
void
onMovieFinished();
96
97
protected
:
98
void
load() override;
99
void
componentComplete() override;
100
101
private
:
102
Q_DISABLE_COPY(QQuickAnimatedImage)
103
Q_DECLARE_PRIVATE(QQuickAnimatedImage)
104
};
105
106
QT_END_NAMESPACE
107
108
#
endif
// QQUICKANIMATEDIMAGE_P_H
QQuickAnimatedImagePrivate
Definition
qquickanimatedimage_p_p.h:34
QQuickAnimatedImagePrivate::movie
QMovie * movie
Definition
qquickanimatedimage_p_p.h:49
QQuickAnimatedImagePrivate::handleLoopCompletion
void handleLoopCompletion()
Definition
qquickanimatedimage.cpp:57
QQuickAnimatedImagePrivate::clearCache
void clearCache()
Definition
qquickanimatedimage.cpp:51
QQuickAnimatedImagePrivate::setMovie
void setMovie(QMovie *movie)
Definition
qquickanimatedimage.cpp:624
QQuickAnimatedImagePrivate::lastFrameNumber
int lastFrameNumber
Definition
qquickanimatedimage_p_p.h:64
QQuickAnimatedImagePrivate::currentLoop
int currentLoop
Definition
qquickanimatedimage_p_p.h:63
QQuickAnimatedImage
Definition
qquickanimatedimage_p.h:31
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(quick_animatedimage)
qtdeclarative
src
quick
items
qquickanimatedimage_p.h
Generated on
for Qt by
1.18.0