So I have created a nested list in QML:
ListModel {
id: players
ListElement {
name: "Player 1"
counters: [
ListElement {
name: "Life"
count: 20
edit: false
} ,
ListElement {
name: "Poison"
count: 0
edit: false
}
]
}
//etc...
}
And, I have two views that read data from this: a ListView that is given the first-level ListModel, and a GridView that reads from the counters second-level model. I have given the GridView the counters list through the attached property in the delegate, like so:
GridView {
model: counters
}
Initially, it reads the data just fine. But my problem is that when the second-level model data is updated from outside the delegate, the GridView does not update with the new data. How do I get it to update?
When looking around, I have seen other people just create two separate models, but the problem is that I need the information in the nested list to be associated with the ListElement that contains it, so that really is not an option.