From d3178ea15f793295ac04317f4f08deeacb6e8690 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 15 Aug 2007 22:08:00 +0000 Subject: Smoother animations for the pixmap viewer if the pixmap is changed constantly during small time slots (thanks to Rafael Fernández López for the original patch!). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/KDE/kdebase/apps/; revision=700580 --- src/pixmapviewer.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/pixmapviewer.h') diff --git a/src/pixmapviewer.h b/src/pixmapviewer.h index 165c40455..ba0dda9cd 100644 --- a/src/pixmapviewer.h +++ b/src/pixmapviewer.h @@ -20,9 +20,10 @@ #ifndef PIXMAPVIEWER_H #define PIXMAPVIEWER_H -#include -#include -#include +#include +#include +#include +#include class QPaintEvent; @@ -63,21 +64,27 @@ public: virtual ~PixmapViewer(); void setPixmap(const QPixmap& pixmap); - const QPixmap& pixmap() const - { - return m_pixmap; - } + inline const QPixmap& pixmap() const; protected: virtual void paintEvent(QPaintEvent* event); +private Q_SLOTS: + void checkPendingPixmaps(); + private: QPixmap m_pixmap; QPixmap m_oldPixmap; + QQueue m_pendingPixmaps; QTimeLine m_animation; Transition m_transition; int m_animationStep; }; +const QPixmap& PixmapViewer::pixmap() const +{ + return m_pixmap; +} + #endif -- cgit v1.3