XmlRole
For specifying a role to an XmlListModel More...
Properties
Detailed Description
See also QtQml.
Property Documentation
Defines whether this is a key role. Key roles are used to determine whether a set of values should be updated or added to the XML list model when XmlListModel::reload() is called.
See also XmlListModel.
The name for the role. This name is used to access the model data for this role.
For example, the following model has a role named "title", which can be accessed from the view's delegate:
XmlListModel { id: xmlModel // ... XmlRole { name: "title" query: "title/string()" } }
ListView { model: xmlModel delegate: Text { text: title } }
The relative XPath expression query for this role. The query must be relative; it cannot start with a '/'.
For example, if there is an XML document like this:
Here are some valid XPath expressions for XmlRole queries on this document:
...
See the W3C XPath 2.0 specification for more information.