Warning, file /include/QtGui/qmovie.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef QMOVIE_H
0005 #define QMOVIE_H
0006
0007 #include <QtGui/qtguiglobal.h>
0008
0009 #include <QtCore/qobject.h>
0010 #include <QtCore/qbytearray.h>
0011 #include <QtCore/qlist.h>
0012 #include <QtGui/qimagereader.h>
0013
0014 QT_REQUIRE_CONFIG(movie);
0015
0016 QT_BEGIN_NAMESPACE
0017
0018 class QByteArray;
0019 class QColor;
0020 class QIODevice;
0021 class QImage;
0022 class QPixmap;
0023 class QRect;
0024 class QSize;
0025
0026 class QMoviePrivate;
0027 class Q_GUI_EXPORT QMovie : public QObject
0028 {
0029 Q_OBJECT
0030 Q_DECLARE_PRIVATE(QMovie)
0031 Q_PROPERTY(int speed READ speed WRITE setSpeed BINDABLE bindableSpeed)
0032 Q_PROPERTY(CacheMode cacheMode READ cacheMode WRITE setCacheMode BINDABLE bindableCacheMode)
0033 public:
0034 enum MovieState {
0035 NotRunning,
0036 Paused,
0037 Running
0038 };
0039 Q_ENUM(MovieState)
0040 enum CacheMode {
0041 CacheNone,
0042 CacheAll
0043 };
0044 Q_ENUM(CacheMode)
0045
0046 explicit QMovie(QObject *parent = nullptr);
0047 explicit QMovie(QIODevice *device, const QByteArray &format = QByteArray(), QObject *parent = nullptr);
0048 explicit QMovie(const QString &fileName, const QByteArray &format = QByteArray(), QObject *parent = nullptr);
0049 ~QMovie();
0050
0051 static QList<QByteArray> supportedFormats();
0052
0053 void setDevice(QIODevice *device);
0054 QIODevice *device() const;
0055
0056 void setFileName(const QString &fileName);
0057 QString fileName() const;
0058
0059 void setFormat(const QByteArray &format);
0060 QByteArray format() const;
0061
0062 void setBackgroundColor(const QColor &color);
0063 QColor backgroundColor() const;
0064
0065 MovieState state() const;
0066
0067 QRect frameRect() const;
0068 QImage currentImage() const;
0069 QPixmap currentPixmap() const;
0070
0071 bool isValid() const;
0072 QImageReader::ImageReaderError lastError() const;
0073 QString lastErrorString() const;
0074
0075 bool jumpToFrame(int frameNumber);
0076 int loopCount() const;
0077 int frameCount() const;
0078 int nextFrameDelay() const;
0079 int currentFrameNumber() const;
0080
0081 int speed() const;
0082 QBindable<int> bindableSpeed();
0083
0084 QSize scaledSize();
0085 void setScaledSize(const QSize &size);
0086
0087 CacheMode cacheMode() const;
0088 void setCacheMode(CacheMode mode);
0089 QBindable<CacheMode> bindableCacheMode();
0090
0091 Q_SIGNALS:
0092 void started();
0093 void resized(const QSize &size);
0094 void updated(const QRect &rect);
0095 void stateChanged(QMovie::MovieState state);
0096 void error(QImageReader::ImageReaderError error);
0097 void finished();
0098 void frameChanged(int frameNumber);
0099
0100 public Q_SLOTS:
0101 void start();
0102 bool jumpToNextFrame();
0103 void setPaused(bool paused);
0104 void stop();
0105 void setSpeed(int percentSpeed);
0106
0107 private:
0108 Q_DISABLE_COPY(QMovie)
0109 Q_PRIVATE_SLOT(d_func(), void _q_loadNextFrame())
0110 };
0111
0112 QT_END_NAMESPACE
0113
0114 #endif