summaryrefslogtreecommitdiffstats
path: root/src/declarative
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
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')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp9
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp10
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp12
4 files changed, 40 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 99ab053..2739ab8 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -232,6 +232,16 @@ qreal QDeclarativeImage::paintedHeight() const
\o Error - an error occurred while loading the image
\endlist
+ Note that a change in the status property does not cause anything to happen
+ (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. State{name: 'loaded'; when: image.status = Image.Ready;}
+ \o Do something inside the onStatusChanged signal handler, e.g. Image{id: image; onStatusChanged: if(image.status == Image.Ready) console.log('Loaded');}
+ \o Bind to the status variable somewhere, e.g. Text{text: if(image.status!=Image.Ready){'Not Loaded';}else{'Loaded';}}
+ \endlist
+
\sa progress
*/
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index bd89321..b0499d7 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -320,6 +320,15 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
\o Error - an error occurred while loading the QML source
\endlist
+ Note that a change in the status property does not cause anything to happen
+ (although it reflects what has happened to the 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 = Loader.Ready;}
+ \o Do something inside the onStatusChanged signal handler, e.g. Loader{id: loader; onStatusChanged: if(loader.status == Loader.Ready) console.log('Loaded');}
+ \o Bind to the status variable somewhere, e.g. Text{text: if(loader.status!=Loader.Ready){'Not Loaded';}else{'Loaded';}}
+ \endlist
\sa progress
*/
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
*/