diff options
| author | Peter Penz <[email protected]> | 2007-08-15 22:08:00 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-08-15 22:08:00 +0000 |
| commit | d3178ea15f793295ac04317f4f08deeacb6e8690 (patch) | |
| tree | bad8694a318fd4cb600efefd6b8b6ff47f4ac211 /src/pixmapviewer.h | |
| parent | 548104b1fbca58f504932cc1f2e0eda1ec5c6488 (diff) | |
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!).
svn path=/trunk/KDE/kdebase/apps/; revision=700580
Diffstat (limited to 'src/pixmapviewer.h')
| -rw-r--r-- | src/pixmapviewer.h | 21 |
1 files changed, 14 insertions, 7 deletions
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 <QtGui/QWidget> -#include <QtGui/QPixmap> -#include <QtCore/QTimeLine> +#include <QWidget> +#include <QPixmap> +#include <QQueue> +#include <QTimeLine> 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<QPixmap> m_pendingPixmaps; QTimeLine m_animation; Transition m_transition; int m_animationStep; }; +const QPixmap& PixmapViewer::pixmap() const +{ + return m_pixmap; +} + #endif |
