From 9c89e2f83415c876f28f15ebff31c8325754a936 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 27 Nov 2016 06:52:50 +0100 Subject: Add picture viewer Opens on doubleclick when it's image/*. --- viewer.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 viewer.h (limited to 'viewer.h') diff --git a/viewer.h b/viewer.h new file mode 100644 index 0000000..6f9537e --- /dev/null +++ b/viewer.h @@ -0,0 +1,26 @@ +#ifndef VIEWER_H +#define VIEWER_H + +#include + +class QLabel; +class QWheelEvent; + +class Viewer : public QWidget { + public: + Viewer(QWidget *parent = 0, Qt::WindowFlags f = 0); + void setFile(const QString &file, bool allFiles = true); + + protected: + virtual void wheelEvent(QWheelEvent *event); + + private slots: + void displayFile(int index); + + private: + int mCurIndex; + QLabel *mLabel; + QStringList mFiles; +}; + +#endif // VIEWER_H -- cgit v1.2.3-70-g09d2