summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativexmllistmodel.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-06-15 12:55:18 (GMT)
committerMartin Smith <martin.smith@nokia.com>2010-06-15 12:55:18 (GMT)
commit2cb5d8f7425bce83b5e95925e15d7920be3d2e8d (patch)
tree8b44fe4a9c0fc286e0017a6f34e669d53cb0299e /src/declarative/util/qdeclarativexmllistmodel.cpp
parente9e93fe79d7451f05a714241f759c557a455de67 (diff)
parent11420641d9341af6615baa21453e08c092f7fb10 (diff)
downloadQt-2cb5d8f7425bce83b5e95925e15d7920be3d2e8d.zip
Qt-2cb5d8f7425bce83b5e95925e15d7920be3d2e8d.tar.gz
Qt-2cb5d8f7425bce83b5e95925e15d7920be3d2e8d.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/declarative/util/qdeclarativexmllistmodel.cpp')
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 4f9355b..4adef25 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -523,10 +523,13 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
A XmlListModel could create a model from this data, like this:
\qml
+ import Qt 4.7
+
XmlListModel {
id: xmlModel
source: "http://www.mysite.com/feed.xml"
query: "/rss/channel/item"
+
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "pubDate"; query: "pubDate/string()" }
}
@@ -536,7 +539,7 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
a model item for each \c <item> in the XML document.
The XmlRole objects define the
- model item attributes; here, each model item will have \c title and \c pubDate
+ model item attributes. Here, each model item will have \c title and \c pubDate
attributes that match the \c title and \c pubDate values of its corresponding \c <item>.
(See \l XmlRole::query for more examples of valid XPath expressions for XmlRole.)
@@ -672,11 +675,11 @@ void QDeclarativeXmlListModel::setSource(const QUrl &src)
/*!
\qmlproperty string XmlListModel::xml
- This property holds XML text set directly.
+ This property holds the XML data for this model, if set.
The text is assumed to be UTF-8 encoded.
- If both source and xml are set, xml will be used.
+ If both \l source and \c xml are set, \c xml will be used.
*/
QString QDeclarativeXmlListModel::xml() const
{
@@ -733,6 +736,7 @@ void QDeclarativeXmlListModel::setQuery(const QString &query)
source: "http://mysite.com/feed.xml"
query: "/feed/entry"
namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
+
XmlRole { name: "title"; query: "title/string()" }
}
\endqml