Using booleans in XmlModelList
-
I'm experimenting with the XmlModelList and I can get string() and number() data to behave but not booleans. According to the Qt Assitant docs on XmlRole if your data has an attribute like wanted="true" Then you use
@@XmlRole { name: "wanted"; query: "boolean(@wanted)" }@The problem is that this always returns true for wanted even if it's wanted="false" or wanted="0" in the XML data. If the attribute is missing entirely then it returns false. Here's a snippet of my actual test XML data
@ <clip href="qt-quick--m07-c01.wmv" title="Overview" awesome="false"/>
<clip href="qt-quick--m07-c02.wmv" title="Transforms" awesome="0" />
<clip href="qt-quick--m07-c03.wmv" title="Demo: Transforms" awesome="junk"/>
<clip href="qt-quick--m07-c04.wmv" title="Animation" awesome="true"/>
<clip href="qt-quick--m07-c05.wmv" title="Easings"/>@The XmlRole is defined as:
@XmlRole{name: "awesome" ; query:"boolean(@awesome)"}@The ListView delegate is:
@delegate : Text {text :title
font.bold : awesome
wrapMode: Text.WordWrap
width:200}@The first four titles show up in bold. The fifth item does not.
Again I'm just trying to increase my understanding. I can think of workarounds I would just like to understand how booleans are supposed to be used.