Allow image providers to force their loading to be asynchronous
authorTor Arne Vestbø <tor.arne.vestbo@nokia.com>
Tue, 8 May 2012 08:28:24 +0000 (10:28 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 11 May 2012 13:12:15 +0000 (15:12 +0200)
commit125f4ceb393886015574a3c3fd0fc264a4f2deb6
treec552a05bd3030dd8c3d9a2c307e9dca0a1b9e7e9
parent9b224d33216b0e21292b44743aa4594665ebf970
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>
src/qml/qml/qqmlengine.cpp
src/qml/qml/qqmlengine.h
src/quick/util/qquickimageprovider.cpp
src/quick/util/qquickimageprovider.h
src/quick/util/qquickpixmapcache.cpp
tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp