From 08c7cc837379ae4f085a6cc0d44a8b58bdb5a030 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 10 Mar 2012 07:29:20 +0100 Subject: Slide show Implement slide show in Pictureviewer2. Slide over all available files and wrap around when reaching the end of the list. Also added some more artwork. --- pictureviewer2.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pictureviewer2.h') diff --git a/pictureviewer2.h b/pictureviewer2.h index 21e6454..9610da1 100644 --- a/pictureviewer2.h +++ b/pictureviewer2.h @@ -15,6 +15,8 @@ class QGraphicsScene; class QGraphicsPixmapItem; class QWheelEvent; +class QContextMenuEvent; +class QTimer; typedef QList PicData; typedef QList > PicDataList; @@ -30,9 +32,11 @@ class PictureViewer2 : public QGraphicsView { public slots: void next(); void previous(); + void slide(); protected: - void wheelEvent(QWheelEvent *event); + virtual void wheelEvent(QWheelEvent *event); + virtual void contextMenuEvent(QContextMenuEvent *e); private slots: void showFile(const PicData &file); @@ -46,6 +50,7 @@ class PictureViewer2 : public QGraphicsView { QSize mMinimunSize; QGraphicsPixmapItem *mCur; int mCurPos; + QTimer *mSlideTimer; const QString mDefaultFile; }; -- cgit v1.2.3-70-g09d2