diff options
author | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2012-05-08 10:28:24 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-11 15:12:15 +0200 |
commit | 125f4ceb393886015574a3c3fd0fc264a4f2deb6 (patch) | |
tree | c552a05bd3030dd8c3d9a2c307e9dca0a1b9e7e9 /src/quick/util/qquickimageprovider.h | |
parent | 9b224d33216b0e21292b44743aa4594665ebf970 (diff) |
Allow image providers to force their loading to be asynchronous
The request methods of an image provider are assumed to be synchronous,
but sometimes the provider will be implemented in an async manner, eg.
through network request or doing the I/O on a different thread. In that
case, the provider can't expose this async behavior to clients, but needs
to block in the request method. This is less then ideal for clients,
since the default behvior of an image element is to load synchronously,
so we introduce a new flag to image providers that let's the provider
force the loading to happen on the async image loading thread.
Similar to network requests (which are always async), this does not
affect the 'asynchronous' property of the image element.
Change-Id: I9542abbcc594b9aab565210bc3005a95592c1e9c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reviewed-by: Michalina Ziemba <michalina.ziemba@nokia.com>
Diffstat (limited to 'src/quick/util/qquickimageprovider.h')
-rw-r--r-- | src/quick/util/qquickimageprovider.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/util/qquickimageprovider.h b/src/quick/util/qquickimageprovider.h index 252d57b1d6..459b3ea48d 100644 --- a/src/quick/util/qquickimageprovider.h +++ b/src/quick/util/qquickimageprovider.h @@ -71,10 +71,11 @@ public: class Q_QUICK_EXPORT QQuickImageProvider : public QQmlImageProviderBase { public: - QQuickImageProvider(ImageType type); + QQuickImageProvider(ImageType type, Flags flags = 0); virtual ~QQuickImageProvider(); ImageType imageType() const; + Flags flags() const; virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize); virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize); |