diff options
author | David Greaves <david@dgreaves.com> | 2013-12-27 22:37:25 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-17 09:57:47 +0100 |
commit | 003bac68790dec149eb5cc085bd8a25b468fb155 (patch) | |
tree | 4fbaea51cb7f68f9427ded7613eebbcc5e84954b | |
parent | 1bec5e806c909d723994dab46271dfe6f60db6cd (diff) |
Add docs on using a query in XMLRole with the less obvious boolean()
Added to a documentation snippet since a direct boolean map is useful
in QML for toggles and using "@wanted/boolean()" as the @type example
does, would be wrong.
Change-Id: If412ec0f4891db39fe1a219f9cb89e1f7103fd38
Signed-off-by: David Greaves <david@dgreaves.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
-rw-r--r-- | src/quick/doc/snippets/qml/xmlrole.qml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/doc/snippets/qml/xmlrole.qml b/src/quick/doc/snippets/qml/xmlrole.qml index 0f75135da2..b1fb674e3e 100644 --- a/src/quick/doc/snippets/qml/xmlrole.qml +++ b/src/quick/doc/snippets/qml/xmlrole.qml @@ -65,6 +65,9 @@ XmlListModel { // query the book's first listed author (note in XPath the first index is 1, not 0) XmlRole { name: "first_author"; query: "author[1]/string()" } + + // query the wanted attribute as a boolean + XmlRole { name: "wanted"; query: "boolean(@wanted)" } } //![1] |