diff options
author | Arno <am@disconnect.de> | 2012-03-08 07:09:09 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2012-03-08 07:09:09 +0100 |
commit | ea30d012b7777a2aea1c5e957a7d7566eebef391 (patch) | |
tree | 88a1ebdcca7a3184781d4ed4ac29b3892df04d6c /pictureviewer2.h | |
parent | 57f69839e3bab9ab73f15811374099576216282b (diff) | |
download | SheMov-ea30d012b7777a2aea1c5e957a7d7566eebef391.tar.gz SheMov-ea30d012b7777a2aea1c5e957a7d7566eebef391.tar.bz2 SheMov-ea30d012b7777a2aea1c5e957a7d7566eebef391.zip |
Show picture on doubleClick in PicturesWidget
Show picture in PictureViewer2 when double clicking an item in pictures
widget. Also shuffle some code around.
Diffstat (limited to 'pictureviewer2.h')
-rw-r--r-- | pictureviewer2.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/pictureviewer2.h b/pictureviewer2.h index 7b106bf..6c9035a 100644 --- a/pictureviewer2.h +++ b/pictureviewer2.h @@ -13,16 +13,25 @@ class QGraphicsScene; class QGraphicsPixmapItem; +class QWheelEvent; class PictureViewer2 : public QGraphicsView { Q_OBJECT public: - explicit PictureViewer2(QWidget *parent = 0); //, Qt::WindowFlags f = 0); - void setFiles(const QStringList &files) { mFiles = files; } + explicit PictureViewer2(QWidget *parent = 0); + void addFiles(const QStringList &files, bool clear = true); + void setFile(const QString &file); virtual QSize sizeHint() const; + public slots: + void next(); + void previous(); + + protected: + void wheelEvent(QWheelEvent *event); + private slots: - void setFile(const QString file = mDefaultFile); + void showFile(const QString file); private: void setupDialog(); @@ -32,7 +41,8 @@ class PictureViewer2 : public QGraphicsView { QGraphicsScene *mScene; QSize mMinimunSize; QGraphicsPixmapItem *mCur; - static const QString mDefaultFile; + int mCurPos; + const QString mDefaultFile; }; #endif // PICTUREVIEWER2_H |