diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2023-09-13 21:55:47 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2023-09-14 10:51:35 +0000 |
commit | 726f2730e7468073c49b2f775986372735b22e4e (patch) | |
tree | 8e1004a03aacd1f582d5461b5017f71b45121af8 /src/plugins/imageviewer/imageviewerfile.h | |
parent | 7fc69e1063c310d98d691394526fce0015a11f95 (diff) |
ImageViewer: Fix animation playback replay and loop
This fixes the issue that looped animated images do not automatically
loop and that animations can generally not be replayed from start.
It introduces the "resume" state to the tool bar icon in order to
distinguish between "playing an animation from start" and "resuming the
playback of a paused animation".
The setting cache mode QMovie::CacheAll was removed because it prevents
a looped animation from looping, and also its memory consumption (which
depends on animation dimension and frames) does not seem to be
positively outweighed by anything else.
Fixes: QTCREATORBUG-29606
Change-Id: Iaca8d93766201f5f953784be7ee6d56610e63695
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Diffstat (limited to 'src/plugins/imageviewer/imageviewerfile.h')
-rw-r--r-- | src/plugins/imageviewer/imageviewerfile.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/imageviewer/imageviewerfile.h b/src/plugins/imageviewer/imageviewerfile.h index fc1c73f8de8..26ed01a94fe 100644 --- a/src/plugins/imageviewer/imageviewerfile.h +++ b/src/plugins/imageviewer/imageviewerfile.h @@ -6,9 +6,10 @@ #include <coreplugin/idocument.h> +#include <QMovie> + QT_BEGIN_NAMESPACE class QGraphicsItem; -class QMovie; class QPixmap; #ifndef QT_NO_SVG @@ -40,8 +41,7 @@ public: ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override; bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override; - bool isPaused() const; - void setPaused(bool paused); + QMovie *movie() const; QGraphicsItem *createGraphicsItem() const; ImageType type() const; @@ -51,7 +51,7 @@ public: signals: void openFinished(bool success); void imageSizeChanged(const QSize &size); - void isPausedChanged(bool paused); + void movieStateChanged(); private: void cleanUp(); @@ -63,7 +63,6 @@ private: #endif QMovie *m_movie = nullptr; QPixmap *m_pixmap = nullptr; - bool m_isPaused = false; }; } // ImageViewer::Internal |