#ifndef PIXMAPVIEWER_H
#define PIXMAPVIEWER_H
-#include <QWidget>
#include <QPixmap>
#include <QQueue>
#include <QTimeLine>
+#include <QWidget>
class QPaintEvent;
+class QMovie;
/**
* @brief Widget which shows a pixmap centered inside the boundaries.
void setSizeHint(const QSize& size);
QSize sizeHint() const override;
+ void setAnimatedImageFileName(const QString& fileName);
+ QString animatedImageFileName() const;
+
+ void stopAnimatedImage();
+
+ /**
+ * Checks if \a mimeType has a format supported by QMovie.
+ */
+ static bool isAnimatedMimeType(const QString &mimeType);
+
protected:
void paintEvent(QPaintEvent* event) override;
private Q_SLOTS:
void checkPendingPixmaps();
+ void updateAnimatedImageFrame();
private:
QPixmap m_pixmap;
QPixmap m_oldPixmap;
+ QMovie* m_animatedImage;
QQueue<QPixmap> m_pendingPixmaps;
QTimeLine m_animation;
Transition m_transition;
int m_animationStep;
QSize m_sizeHint;
+ bool m_hasAnimatedImage;
};
inline QPixmap PixmapViewer::pixmap() const