QQuickImageResponseclass provides an interface for asynchronous image loading in
New in version 5.6.
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
finished()signal has been emitted. If you are using
QRunnableas base for your
QQuickImageResponseensure automatic deletion is disabled.
See the Image Response Provider Example for a complete implementation.
- class PySide2.QtQuick.QQuickImageResponse¶
Constructs the image response
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.
QQuickImageResponsestill needs to emit
finished()so that the engine may clean up the
finished()should not be emitted until the response is complete, regardless of whether or not was called. If it is called prematurely, the engine may destroy the response while it is still active, leading to a crash.
- Return type:
Returns the error string for the job execution. An empty string means no error.
- Return type:
Returns the texture factory for the job. You can use
textureFactoryForImageif your provider works with
QImage. The engine takes ownership of the returned
This method will be called only when needed. For example, it may not be called if there is an error or the job is cancelled. Therefore, allocate the
QQuickTextureFactoryinstance only in this method or otherwise ensure its deletion.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.