| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Slots | Public Member Functions | Protected Slots | List of all members
Digikam::ThumbnailImageCatcher Class Reference
Inheritance diagram for Digikam::ThumbnailImageCatcher:

## Public Slots
void | cancel ()
| If the catcher is waiting in waitForThumbnails() in a different thread, cancels the waiting.
void | setActive (bool active)
| The catcher is active per default after construction.

## Public Member Functions
| ThumbnailImageCatcher (QObject *const parent=nullptr)
| Use this class to get a thumbnail synchronously.
| ThumbnailImageCatcher (ThumbnailLoadThread *const thread, QObject *const parent=nullptr)
int | enqueue ()
| After requesting a thumbnail from the thread, call enqueue() each time.
void | setThumbnailLoadThread (ThumbnailLoadThread *const thread)
ThumbnailLoadThread * | thread () const
QList< QImage > | waitForThumbnails ()

## Protected Slots
void | slotThumbnailLoaded (const LoadingDescription &, const QImage &)

## Constructor & Destructor Documentation

## ◆ ThumbnailImageCatcher()

Digikam::ThumbnailImageCatcher::ThumbnailImageCatcher | ( | QObject *const | parent = `nullptr` | ) |
| explicit

1. Create the ThumbnailImageCatcher object with your ThumbnailLoadThread
2. a) Request a thumbnail b) Call enqueue()
3. Call waitForThumbnails which returns the thumbnail QImage(s).

Note: Not meant for loading QPixmap thumbnails.

## Member Function Documentation

## ◆ cancel

void Digikam::ThumbnailImageCatcher::cancel | ( |  | ) |
| slot

The results will be returned as received so far.

## ◆ enqueue()

int Digikam::ThumbnailImageCatcher::enqueue | ( |  | ) |

Enqueue records the requested loading operation in an internal list. A loading operation can result in the return of more than one thumbnail, so enqueue() returns the number of expected results. Then call waitForThumbnails. The returned list is the sum of previous calls to enqueue, one entry per expected result, in order. If stopped prematurely or loading failed, the respective entries will be null.

## ◆ setActive

void Digikam::ThumbnailImageCatcher::setActive | ( | bool | active | ) |
| slot

Deactivate it if you use the catcher as a longer-lived object and do not use it for some time, then activate it before you request a thumbnail from the thread again.