]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/pixmapviewer.h
disable rating, comments and tags if no meta data is available
[dolphin.git] / src / pixmapviewer.h
index 165c40455d78209eab383b24b826a48d9c6cce65..26e520aab3bc05e117bbdf1d242aa4c011891580 100644 (file)
 #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,35 @@ public:
 
     virtual ~PixmapViewer();
     void setPixmap(const QPixmap& pixmap);
-    const QPixmap& pixmap() const
-    {
-        return m_pixmap;
-    }
+    const QPixmap& pixmap() const;
+
+    /**
+     * Sets the size hint to \a size and triggers a relayout
+     * of the parent widget. Per default no size hint is given.
+     */
+    void setSizeHint(const QSize& size);
+    virtual QSize sizeHint() 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;
+    QSize m_sizeHint;
 };
 
+inline const QPixmap& PixmapViewer::pixmap() const
+{
+    return m_pixmap;
+}
+
 
 #endif