Qt 6.11 is out! See what's new in the release
blog
Dynamic listview from json
-
Hi everyone, I was wondering if someone could help me create a listview with a QAbstractListModel attached that reads a json file that contains an array of (equal) objects and automatically sets the column names from the keys of the objects and the rows from the content of the array. Is is possible to do that? I can't wrap my head around on how to structure it
-
You might wanna have a look at the document viewer example.
It reads any JSON file and displays it in a tree model.
If your JSON is always a specific array, you can easily plumb that into a list view. -
https://github.com/benlau/qsyncable does that