diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-11-04 06:05:30 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-11-04 06:06:25 (GMT) |
commit | eedb9980c89e77e21e1336195930a148b6a2e712 (patch) | |
tree | 863d51fef79d39c1bcd905790d3b208334c110ee /src/declarative/graphicsitems/qdeclarativeloader.cpp | |
parent | b5588ded342ed9dbc9f00fc8a4091e447880eccc (diff) | |
download | Qt-eedb9980c89e77e21e1336195930a148b6a2e712.zip Qt-eedb9980c89e77e21e1336195930a148b6a2e712.tar.gz Qt-eedb9980c89e77e21e1336195930a148b6a2e712.tar.bz2 |
Fix errors in example code. Also reverts the example code to the old
list format.
Task-number: QTBUG-14871
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeloader.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeloader.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index 7777567..109fbbb 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -395,23 +395,25 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded() 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: loader.status = Loader.Ready } + \list + \o Trigger a state change: + \qml + State { name: 'loaded'; when: loader.status == Loader.Ready } \endqml - \e {Implement an \c onStatusChanged signal handler:} - \qml + \o Implement an \c onStatusChanged signal handler: + \qml Loader { id: loader onStatusChanged: if (loader.status == Loader.Ready) console.log('Loaded') } \endqml - \e {Bind to the status value:} + \o Bind to the status value: \qml - Text { text: loader.status != Loader.Ready ? 'Not Loaded' : 'Loaded' } + Text { text: loader.status == Loader.Ready ? 'Loaded' : 'Not loaded' } \endqml + \endlist Note that if the source is a local file, the status will initially be Ready (or Error). While there will be no onStatusChanged signal in that case, the onLoaded will still be invoked. |