summaryrefslogtreecommitdiffstats
path: root/pictureviewer.h
diff options
context:
space:
mode:
Diffstat (limited to 'pictureviewer.h')
-rw-r--r--pictureviewer.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/pictureviewer.h b/pictureviewer.h
new file mode 100644
index 0000000..2791bbe
--- /dev/null
+++ b/pictureviewer.h
@@ -0,0 +1,45 @@
+/*
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version
+ 2 of the License, or (at your option) any later version.
+*/
+
+#ifndef PICTUREVIEWER_H
+#define PICTUREVIEWER_H
+
+#include <QGraphicsView>
+#include <QFileInfoList>
+
+class QGraphicsScene;
+class QGraphicsPixmapItem;
+class QWheelEvent;
+class PictureviewerInfoItem;
+
+class PictureViewer : public QGraphicsView {
+ Q_OBJECT
+ public:
+ PictureViewer(QWidget *parent = 0);
+
+ public slots:
+ void showPic(const QString &path);
+ void next();
+ void previous();
+
+ protected:
+ void wheelEvent(QWheelEvent *event);
+
+ private:
+ void setGradient();
+ void setDir(const QString &path);
+ bool isPic(const QString &path);
+ QPointF center(const QPixmap &pic);
+ QGraphicsScene *mScene;
+ QGraphicsPixmapItem *mCurrentPic;
+ PictureviewerInfoItem *mInfoItem;
+ QString mCurrentDir;
+ QFileInfoList mDirEntries;
+ QFileInfoList::const_iterator mCurrentEntry;
+};
+
+#endif