Use subAlpha.append()
. Esse método usa um objeto Javascript como um argumento, que é usado para criar um novo ListElement com essas chaves e valores.
Um exemplo de trabalho:
import QtQuick 2.0
ListView {
width: 200
height: 200
ListModel {
id: mainModel
ListElement {
name: "Alphabet"
subAlpha: [
ListElement {
alphaName: "A"
},
ListElement {
alphaName: "B"
}
]
}
}
model: mainModel
delegate: Column {
Text { text: name }
Row {
Repeater {
model: subAlpha
Text { text: alphaName }
}
}
}
Component.onCompleted: {
mainModel.get(0).subAlpha.append({alphaName: "C"})
}
}