QQuickImageResponse Class

The QQuickImageResponse class provides an interface for asynchronous image loading in QQuickAsyncImageProvider. More...

Header: #include <QQuickImageResponse>
qmake: QT += quick
Since: Qt 5.6
Inherits: QObject

This class was introduced in Qt 5.6.

Public Functions

QQuickImageResponse()
virtual ~QQuickImageResponse() override
virtual QString errorString() const
  • 30 public functions inherited from QObject

Public Slots

virtual void cancel()
  • 1 public slot inherited from QObject
typedef QObjectList
QList<T> qFindChildren(const QObject *obj, const QRegExp &regExp)
T qobject_cast(QObject *object)
T qobject_cast(const QObject *object)

Macros

Additional Inherited Members

  • 1 property inherited from QObject
  • 2 signals inherited from QObject
  • 9 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The purpose of an image response is to provide a way for image provider jobs to be executed in an asynchronous way.

Responses are deleted via deleteLater once the finished() signal has been emitted. If you are using QRunnable as base for your QQuickImageResponse ensure automatic deletion is disabled.

See the Image Response Provider Example for a complete implementation.

See also QQuickImageProvider.

Member Function Documentation

QQuickImageResponse::QQuickImageResponse()

Constructs the image response

[virtual slot] void QQuickImageResponse::cancel()

This method is used to communicate that the response is no longer required by the engine.

It may be reimplemented to cancel a request in the provider side, however, it is not mandatory.

A cancelled QQuickImageResponse still needs to emit finished() so that the engine may clean up the QQuickImageResponse.

Note: finished() should not be emitted until the response is complete, regardless of whether or not cancel() was called. If it is called prematurely, the engine may destroy the response while it is still active, leading to a crash.

[override virtual] QQuickImageResponse::~QQuickImageResponse()

Destructs the image response

[virtual] QString QQuickImageResponse::errorString() const

Returns the error string for the job execution. An empty string means no error.