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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-05-31 00:42:54 -03:00 committed by Dirk Hohndel
parent e140703d34
commit f1d67cfbac
2 changed files with 30 additions and 2 deletions

View file

@ -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<QString, QPixmap> stringPixmapCache;
};
class DivePictureDelegate : QStyledItemDelegate {