summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-29 06:44:00 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-29 06:44:00 (GMT)
commit6b5d58554cdc1c18c73bfb39e736a3621959ca4c (patch)
tree1e7c2f8f6727e7337cbc0db982da111ab590d6d7 /src
parentf3a8575352e4d2f7b1100274bc9344040c668d01 (diff)
downloadQt-6b5d58554cdc1c18c73bfb39e736a3621959ca4c.zip
Qt-6b5d58554cdc1c18c73bfb39e736a3621959ca4c.tar.gz
Qt-6b5d58554cdc1c18c73bfb39e736a3621959ca4c.tar.bz2
Doc: some simple examples of sourceSize usage.
Task-number: QTBUG-10252
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index e00a9fd..3937778 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -316,6 +316,32 @@ qreal QDeclarativeImage::paintedHeight() const
If the source is a non-scalable image (eg. JPEG), the loaded image will
be no greater than this property specifies. For some formats (currently only JPEG),
the whole image will never actually be loaded into memory.
+
+ The example below will ensure that the size of the image in memory is
+ no larger than 1024x1024 pixels, regardless of the size of the Image element.
+
+ \code
+ Image {
+ anchors.fill: parent
+ source: "images/reallyBigImage.jpg"
+ sourceSize.width: 1024
+ sourceSize.height: 1024
+ }
+ \endcode
+
+ The example below will ensure that the memory used by the image is
+ no more than necessary to display the image at the size of the Image element.
+ Of course if the Image element is resized a costly reload will be required, so
+ use this technique \e only when the Image size is fixed.
+
+ \code
+ Image {
+ anchors.fill: parent
+ source: "images/reallyBigImage.jpg"
+ sourceSize.width: width
+ sourceSize.height: height
+ }
+ \endcode
*/
void QDeclarativeImage::updatePaintedGeometry()