summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeimage.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index fe642e0..4593cf8 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -58,10 +58,8 @@ QT_BEGIN_NAMESPACE
\table
\row
- \o
- \image declarative-qtlogo.png
- \o
- \qml
+ \o \image declarative-qtlogo.png
+ \o \qml
import Qt 4.7
Image { source: "qtlogo.png" }
@@ -281,14 +279,27 @@ qreal QDeclarativeImage::paintedHeight() const
(although it reflects what has happened with the image internally). If you wish
to react to the change in status you need to do it yourself, for example in one
of the following ways:
- \list
- \o Create a state, so that a state change occurs, e.g.
- \qml State { name: 'loaded'; when: image.status = Image.Ready } \endqml
- \o Do something inside the onStatusChanged signal handler, e.g.
- \qml Image { id: image; onStatusChanged: if (image.status == Image.Ready) console.log('Loaded') } \endqml
- \o Bind to the status variable somewhere, e.g.
- \qml Text { text: if (image.status != Image.Ready) { 'Not Loaded' } else { 'Loaded' } } \endqml
- \endlist
+
+ Use this status to provide an update or respond to the status change in some way.
+ For example, you could:
+
+ \e {Trigger a state change:}
+ \qml
+ State { name: 'loaded'; when: image.status = Image.Ready }
+ \endqml
+
+ \e {Implement an \c onStatusChanged signal handler:}
+ \qml
+ Image {
+ id: image
+ onStatusChanged: if (image.status == Image.Ready) console.log('Loaded')
+ }
+ \endqml
+
+ \e {Bind to the status value:}
+ \qml
+ Text { text: image.status != Image.Ready ? 'Not Loaded' : 'Loaded' }
+ \endqml
\sa progress
*/