From f1d67cfbacd1e879725e5ebeb2774439246764a4 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sat, 31 May 2014 00:42:54 -0300 Subject: Add threaded processing of image pixmaps This code adds threaded processing of a batch of images. It uses the QtConcurrent implementations to call a function repeteadly using MAX_THREADS (Qt gets that for us) and returns a list of it. This call is blocking, so while the pixmaps are being scaled in threads, it will wait for all scalling to be done. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/divepicturewidget.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qt-ui/divepicturewidget.h') diff --git a/qt-ui/divepicturewidget.h b/qt-ui/divepicturewidget.h index 062e225d7..ff8d1aa8f 100644 --- a/qt-ui/divepicturewidget.h +++ b/qt-ui/divepicturewidget.h @@ -16,6 +16,10 @@ public: void updateDivePictures(int divenr); private: int numberOfPictures; + // Currently, load the images on the fly + // Later, use a thread to load the images + // Later, save the thumbnails so we don't need to reopen every time. + QHash stringPixmapCache; }; class DivePictureDelegate : QStyledItemDelegate { -- cgit v1.2.3-70-g09d2