digiKam
Digikam::ThumbnailImageCatcher Class Reference
+ Inheritance diagram for Digikam::ThumbnailImageCatcher:

Classes

class  Private
 

Public Slots

void cancel ()
 
void setActive (bool active)
 

Public Member Functions

int enqueue ()
 
void setThumbnailLoadThread (ThumbnailLoadThread *const thread)
 
ThumbnailLoadThreadthread () const
 
 ThumbnailImageCatcher (QObject *const parent=nullptr)
 
 ThumbnailImageCatcher (ThumbnailLoadThread *const thread, QObject *const parent=nullptr)
 
QList< QImage > waitForThumbnails ()
 
 ~ThumbnailImageCatcher () override
 

Protected Slots

void slotThumbnailLoaded (const LoadingDescription &, const QImage &)
 

Constructor & Destructor Documentation

◆ ThumbnailImageCatcher() [1/2]

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

Use this class to get a thumbnail synchronously.

  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.

◆ ThumbnailImageCatcher() [2/2]

Digikam::ThumbnailImageCatcher::ThumbnailImageCatcher ( ThumbnailLoadThread *const  thread,
QObject *const  parent = nullptr 
)
explicit

◆ ~ThumbnailImageCatcher()

Digikam::ThumbnailImageCatcher::~ThumbnailImageCatcher ( )
override

Member Function Documentation

◆ cancel

void Digikam::ThumbnailImageCatcher::cancel ( )
slot

◆ enqueue()

int Digikam::ThumbnailImageCatcher::enqueue ( )

After requesting a thumbnail from the thread, call enqueue() each time. 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.

References Digikam::ThumbnailLoadThread::lastDescriptions(), Digikam::ThumbnailImageCatcher::Private::mutex, Digikam::ThumbnailImageCatcher::Private::tasks, and Digikam::ThumbnailImageCatcher::Private::thread.

Referenced by Digikam::FaceItemRetriever::getThumbnails().

◆ setActive

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

The catcher is active per default after construction. 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.

References Digikam::ThumbnailImageCatcher::Private::active, cancel(), Digikam::ThumbnailImageCatcher::Private::mutex, and Digikam::ThumbnailImageCatcher::Private::reset().

Referenced by Digikam::FaceItemRetriever::getThumbnails().

◆ setThumbnailLoadThread()

◆ slotThumbnailLoaded

◆ thread()

◆ waitForThumbnails()


The documentation for this class was generated from the following files: