summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativexmllistmodel.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-02-10 22:35:31 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-02-10 22:35:31 (GMT)
commitca13ba801144763b1ca7c39b2ef8594de94e2d3e (patch)
tree7600e31df6ce715a5bc28c0c97983bac9484c7cb /src/declarative/util/qdeclarativexmllistmodel.cpp
parentab38731fe5dcfaa1a7a70bc290a8856b5b01524d (diff)
parentec20a6da3edea3031f1705c3b13e24dc2c7c6de5 (diff)
downloadQt-ca13ba801144763b1ca7c39b2ef8594de94e2d3e.zip
Qt-ca13ba801144763b1ca7c39b2ef8594de94e2d3e.tar.gz
Qt-ca13ba801144763b1ca7c39b2ef8594de94e2d3e.tar.bz2
Merge remote-tracking branch 'origin/4.7' into HEAD
Diffstat (limited to 'src/declarative/util/qdeclarativexmllistmodel.cpp')
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 7da4ecd..cf3696b 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -90,10 +90,15 @@ typedef QPair<int, int> QDeclarativeXmlListRange;
\qml
XmlListModel {
id: xmlModel
- ...
- XmlRole { name: "title"; query: "title/string()" }
+ // ...
+ XmlRole {
+ name: "title"
+ query: "title/string()"
+ }
}
+ \endqml
+ \qml
ListView {
model: xmlModel
delegate: Text { text: title }
@@ -382,7 +387,7 @@ void QDeclarativeXmlQuery::doSubQueryJob()
for (int i = 0; i < queries.size(); ++i) {
QList<QVariant> resultList;
if (!queries[i].isEmpty()) {
- subquery.setQuery(m_prefix + QLatin1String("(let $v := ") + queries[i] + QLatin1String(" return if ($v) then ") + queries[i] + QLatin1String(" else \"\")"));
+ subquery.setQuery(m_prefix + QLatin1String("(let $v := string(") + queries[i] + QLatin1String(") return if ($v) then ") + queries[i] + QLatin1String(" else \"\")"));
if (subquery.isValid()) {
QXmlResultItems resultItems;
subquery.evaluateTo(&resultItems);
@@ -792,9 +797,9 @@ void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarati
This will access the \c title value for the first item in the model:
- \qml
- var title = model.get(0).title;
- \endqml
+ \js
+ var title = model.get(0).title;
+ \endjs
*/
QScriptValue QDeclarativeXmlListModel::get(int index) const
{