lomiri::thumbnailer::qt::Request Class Reference

Holds a thumbnailer request. More...

`#include <lomiri/thumbnailer/qt/lomiri-thumbnailer-qt.h>`

## Signals

void | finished ()
| This signal is emitted when the request completes.

## Public Member Functions

| ~Request ()
| Destroys a request.
bool | isFinished () const
| Returns whether the request has completed.
QImage | image () const
| Returns the thumbnail.
QString | errorMessage () const
| Returns the error message for a failed request.
bool | isValid () const
| Returns whether the request completed successfully.
void | waitForFinished ()
| Blocks the calling thread until the request completes.
void | cancel ()
| Cancel the thumbnail request.
bool | isCancelled () const
| Returns whether the request was cancelled.

## Detailed Description

Holds a thumbnailer request.

This class stores the state of an in-progress or completed thumbnail request.

## Constructor & Destructor Documentation

## ~Request()

lomiri::thumbnailer::qt::Request::~Request | ( |  | ) |

Destroys a request.

If the request is still in progress, it is implicitly cancelled, and the finished() signal is not emitted.

Warning
  You must destroy all request instances created by a Thumbnailer before destroying the Thumbnailer instance.

## Member Function Documentation

## cancel()

void lomiri::thumbnailer::qt::Request::cancel | ( |  | ) |

Cancel the thumbnail request.

Cancels the request if it has not completed yet and emits the finished() signal. Calling cancel() more than once or on a request that has already completed does nothing.

## errorMessage()

QString lomiri::thumbnailer::qt::Request::errorMessage | ( |  | ) | const

Returns the error message for a failed request.

Returns
  The error message in case of a failure and an empty QString, otherwise.

## finished

void lomiri::thumbnailer::qt::Request::finished | ( |  | ) |

signal

This signal is emitted when the request completes.

## image()

QImage lomiri::thumbnailer::qt::Request::image | ( |  | ) | const

Returns the thumbnail.

Returns
  A valid QImage if the request was successful and an empty QImage, otherwise.

## isCancelled()

bool lomiri::thumbnailer::qt::Request::isCancelled | ( |  | ) | const

Returns whether the request was cancelled.

Returns
  true if the request was cancelled and false, otherwise.

Note
  Depending on the time at which cancel() is called, the request may complete successfully despite having been cancelled.

## isFinished()

bool lomiri::thumbnailer::qt::Request::isFinished | ( |  | ) | const

Returns whether the request has completed.

Returns
  false if the request is still in progress. Otherwise, the return value is true (whether the request completed successfully or not).

## isValid()

bool lomiri::thumbnailer::qt::Request::isValid | ( |  | ) | const

Returns whether the request completed successfully.

Returns
  true if the request completed successfully. Otherwise, if the request is still in progress, has failed, or was cancelled, the return value is false.

## waitForFinished()

void lomiri::thumbnailer::qt::Request::waitForFinished | ( |  | ) |

Blocks the calling thread until the request completes.

It is safe to call waitForFinished() on the same request more than once. If called on an already-completed (or cancelled) request, waitForFinished() returns immediately.

Warning
  Calling this function from the main (GUI) thread might cause your user interface to freeze.
  Calling waitForFinished() causes the request to be scheduled out of order. This means that, if you send requests for thumbnails A, B, and C (in that order) and then call waitForFinished() on C, you cannot assume that A and B have also finished once waitForFinished() returns.

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

- /build/lomiri-thumbnailer-QhFTRL/lomiri-thumbnailer-3.1.2/include/lomiri/thumbnailer/qt/lomiri-thumbnailer-qt.h