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
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
22
23#include "qquickimage_p.h"
24
26
27class QMovie;
29
30class 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)
37 Q_PROPERTY(int frameCount READ frameCount NOTIFY frameCountChanged)
38 Q_PROPERTY(qreal speed READ speed WRITE setSpeed NOTIFY speedChanged REVISION(2, 11))
39
40 QML_NAMED_ELEMENT(AnimatedImage)
41 QML_ADDED_IN_VERSION(2, 0)
42
43public:
44 QQuickAnimatedImage(QQuickItem *parent=nullptr);
45 ~QQuickAnimatedImage();
46
47 bool isPlaying() const;
48 void setPlaying(bool play);
49
50 bool isPaused() const;
51 void setPaused(bool pause);
52
53 int currentFrame() const override;
54 void setCurrentFrame(int frame) override;
55
56 int frameCount() const override;
57
58 qreal speed() const;
59 void setSpeed(qreal speed);
60
61 // Extends QQuickImage's src property
62 void setSource(const QUrl&) override;
63
64Q_SIGNALS:
65 void playingChanged();
66 void pausedChanged();
67 void frameChanged();
68 void currentFrameChanged();
69 void frameCountChanged();
70 Q_REVISION(2, 11) void speedChanged();
71
72private Q_SLOTS:
73 void movieUpdate();
74 void movieRequestFinished();
75 void playingStatusChanged();
76 void onCacheChanged();
77
78protected:
79 void load() override;
80 void componentComplete() override;
81
82private:
83 Q_DISABLE_COPY(QQuickAnimatedImage)
84 Q_DECLARE_PRIVATE(QQuickAnimatedImage)
85};
86
87QT_END_NAMESPACE
88
89#endif // QQUICKANIMATEDIMAGE_P_H
QT_REQUIRE_CONFIG(quick_animatedimage)