summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-03-01 18:07:41 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-03-01 18:07:41 (GMT)
commit7024111f8615b84741640e8dbbb1dd9482c9e1ea (patch)
treee1b52e8d6b7dfdf5d493205be7b8a08b3b461367 /src/declarative/util
parent2d719ce634efa5e0abfb5d76eb516133753b5a62 (diff)
downloadQt-7024111f8615b84741640e8dbbb1dd9482c9e1ea.zip
Qt-7024111f8615b84741640e8dbbb1dd9482c9e1ea.tar.gz
Qt-7024111f8615b84741640e8dbbb1dd9482c9e1ea.tar.bz2
Expand documention of status property with examples
Task-number: QTBUG-8542
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp10
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp12
2 files changed, 21 insertions, 1 deletions
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index 4d12ae1..8f5f537 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -189,6 +189,16 @@ void QDeclarativeFontLoader::setName(const QString &name)
\o Loading - the font is currently being loaded
\o Error - an error occurred while loading the font
\endlist
+
+ Note that a change in the status property does not cause anything to happen
+ (although it reflects what has happened to the font loader 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. State{name: 'loaded'; when: loader.status = FontLoader.Ready;}
+ \o Do something inside the onStatusChanged signal handler, e.g. FontLoader{id: loader; onStatusChanged: if(loader.status == FontLoader.Ready) console.log('Loaded');}
+ \o Bind to the status variable somewhere, e.g. Text{text: if(loader.status!=FontLoader.Ready){'Not Loaded';}else{'Loaded';}}
+ \endlist
*/
QDeclarativeFontLoader::Status QDeclarativeFontLoader::status() const
{
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 162a669..d260ada 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -647,11 +647,21 @@ void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarati
This property holds the status of data source loading. It can be one of:
\list
\o Null - no data source has been set
- \o Ready - nthe data source has been loaded
+ \o Ready - the data source has been loaded
\o Loading - the data source is currently being loaded
\o Error - an error occurred while loading the data source
\endlist
+ Note that a change in the status property does not cause anything to happen
+ (although it reflects what has happened to the XmlListModel 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. State{name: 'loaded'; when: xmlListModel.status = XmlListModel.Ready;}
+ \o Do something inside the onStatusChanged signal handler, e.g. XmlListModel{id: xmlListModel; onStatusChanged: if(xmlListModel.status == XmlListModel.Ready) console.log('Loaded');}
+ \o Bind to the status variable somewhere, e.g. Text{text: if(xmlListModel.status!=XmlListModel.Ready){'Not Loaded';}else{'Loaded';}}
+ \endlist
+
\sa progress
*/