DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dpicturesequenceview.h
1// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DPICTURESEQUENCEVIEW_H
6#define DPICTURESEQUENCEVIEW_H
7
8#include <dtkwidget_global.h>
9#include <DObject>
10
11#include <QtGlobal>
12#include <QPair>
13#include <QGraphicsView>
14
15DWIDGET_BEGIN_NAMESPACE
16
17class DPictureSequenceViewPrivate;
18class LIBDTKWIDGETSHARED_EXPORT DPictureSequenceView : public QGraphicsView, public DTK_CORE_NAMESPACE::DObject
19{
20 Q_OBJECT
21 Q_PROPERTY(int speed READ speed WRITE setSpeed NOTIFY speedChanged)
22 Q_PROPERTY(bool singleShot READ singleShot WRITE setSingleShot)
23
24public:
25 DPictureSequenceView(QWidget *parent = nullptr);
26
27 void setPictureSequence(const QString &srcFormat, const QPair<int, int> &range, const int fieldWidth = 0, const bool autoScale = false);
28 void setPictureSequence(const QStringList &sequence, const bool autoScale = false);
29 void setPictureSequence(const QList<QPixmap> &sequence, const bool autoScale = false);
30 void play();
31 void pause();
32 void stop();
33
34 int speed() const;
35 void setSpeed(int speed);
36
37 bool singleShot() const;
38 void setSingleShot(bool singleShot);
39
40Q_SIGNALS:
41 void speedChanged(int speed) const;
42 void playEnd() const;
43
44private:
45 D_PRIVATE_SLOT(void _q_refreshPicture())
46
47 Q_DISABLE_COPY(DPictureSequenceView)
48 D_DECLARE_PRIVATE(DPictureSequenceView)
49};
50
51DWIDGET_END_NAMESPACE
52
53#endif // DPICTURESEQUENCEVIEW_H
DPictureSequenceView draw a serial of picture as movie. It trigger picture update by an timer.
Definition dpicturesequenceview.h:19