From 0cdf34c82044a27f1abfe8bd8dce213efa173da8 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 17 Mar 2012 12:36:16 +0100 Subject: Randomize selection for pictureviewer std::random_shuffle available files in PictureViewer2. Add action to View menu and reuse an icon. --- pictureviewer2.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pictureviewer2.cpp') diff --git a/pictureviewer2.cpp b/pictureviewer2.cpp index 88522e0..7a75be1 100644 --- a/pictureviewer2.cpp +++ b/pictureviewer2.cpp @@ -114,6 +114,10 @@ void PictureViewer2::readSettings(){ mBgColor = t.value(); } +void PictureViewer2::shuffle(){ + std::random_shuffle(mFiles.begin(), mFiles.end()); +} + void PictureViewer2::wheelEvent(QWheelEvent *event){ int steps = event->delta() / 8 / 15; if(steps < 0){ -- cgit v1.2.3-70-g09d2