diff options
author | Bea Lam <bea.lam@nokia.com> | 2011-06-01 00:41:14 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2011-06-02 00:13:08 (GMT) |
commit | 7602be09663d37f01cfd640a7f1be959ce4317b7 (patch) | |
tree | dd3f7c2a0777b6de350d8405e7167e7f0c2281fc /src | |
parent | 4fd3f754104f56c625f7cbcca13fa12b4f633957 (diff) | |
download | Qt-7602be09663d37f01cfd640a7f1be959ce4317b7.zip Qt-7602be09663d37f01cfd640a7f1be959ce4317b7.tar.gz Qt-7602be09663d37f01cfd640a7f1be959ce4317b7.tar.bz2 |
Fix docs on caching for images loaded by image providers
Also add docs for 'source' and 'asynchronous' properties for
AnimatedImage.
Task-number: QTBUG-19504
Change-Id: Iec72dc7630308a94c37d00c6b008b5949c6fccd4
Reviewed-by: Martin Jones
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp | 26 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 3 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeimageprovider.cpp | 14 |
3 files changed, 39 insertions, 4 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp index b7fcbb5..8787a5e 100644 --- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp @@ -87,6 +87,32 @@ QT_BEGIN_NAMESPACE */ /*! + \qmlproperty url AnimatedImage::source + + This property holds the URL that refers to the source image. + + AnimatedImage can handle any image format supported by Qt, loaded from any + URL scheme supported by Qt. + + \sa QDeclarativeImageProvider +*/ + +/*! + \qmlproperty bool AnimatedImage::asynchronous + + Specifies that images on the local filesystem should be loaded + asynchronously in a separate thread. The default value is + false, causing the user interface thread to block while the + image is loaded. Setting \a asynchronous to true is useful where + maintaining a responsive user interface is more desirable + than having images immediately visible. + + Note that this property is only valid for images read from the + local filesystem. Images loaded via a network resource (e.g. HTTP) + are always loaded asynchonously. +*/ + +/*! \qmlproperty bool AnimatedImage::cache \since Quick 1.1 diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index b81f631..e9feff4 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -771,9 +771,6 @@ QNetworkAccessManager *QDeclarativeEngine::networkAccessManager() const All required image providers should be added to the engine before any QML sources files are loaded. - Note that images loaded from a QDeclarativeImageProvider are cached - by QPixmapCache, similar to any image loaded by QML. - \sa removeImageProvider() */ void QDeclarativeEngine::addImageProvider(const QString &providerId, QDeclarativeImageProvider *provider) diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp index 559adf4..fa88c00 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.cpp +++ b/src/declarative/qml/qdeclarativeimageprovider.cpp @@ -136,7 +136,8 @@ public: Image providers that support QImage loading automatically include support for asychronous loading of images. To enable asynchronous loading for an - \l Image source, set \l Image::asynchronous to \c true. When this is enabled, + image source, set the \c asynchronous property to \c true for the relevant + \l Image, \l BorderImage or \l AnimatedImage object. When this is enabled, the image request to the provider is run in a low priority thread, allowing image loading to be executed in the background, and reducing the performance impact on the user interface. @@ -147,6 +148,17 @@ public: \c true, the value is ignored and the image is loaded synchronously. + + \section2 Image caching + + Images returned by a QDeclarativeImageProvider are automatically cached, + similar to any image loaded by the QML engine. When an image with a + "image://" prefix is loaded from cache, requestImage() and requestPixmap() + will not be called for the relevant image provider. If an image should always + be fetched from the image provider, and should not be cached at all, set the + \c cache property to \c false for the relevant \l Image, \l BorderImage or + \l AnimatedImage object. + \sa QDeclarativeEngine::addImageProvider() */ |