JSONListModel is a pure-QML component that allows using JSON data as datasource for a QML ListView.
The JSONListModel code is Open Source and available under the MIT license at:
- mimics the XMLListModel component by providing similar API and properties
- supports both source-based and string-based JSON data
- support complex JSON documents and queries via JSONPath (XPath for JSON)
With a file jsonData.txt containing:
We can write:
And use it in views and delegates like this: