ListModel{
id: __model
ListElement{ menuId: "1";menuName:"A"}
ListElement{ menuId: "2";menuName:"B"}
ListElement{ menuId: "3";menuName:"C"}
}
Button{
width: 200
height: 50
onClicked:{
__model.get(0).menuName= "AA" //改
var json = {}
for(var i =0;i<__model.count;i++){
json[__model.get(i).menuId] = __model.get(i).menuName //存
}
for(var key in json){
console.log(json[key])
}
}
}