|
本帖最后由 feeeee 于 2019-10-15 17:18 编辑
TableView{
id: phoneTable
anchors.fill: parent
TableViewColumn {role: "name"; title: "Name"; width: 100; elideMode: Text.ElideRight;}
TableViewColumn {role: "cost"; title: "Cost"; width: 100;}
TableViewColumn {role: "manufacturer"; title: "Manufacturer"; width: 140;}
TableViewColumn {role: "submit"; title: "Submit"; width: 100
delegate: RadioButton{
exclusiveGroup: mos
style: rastyle
text: "提交"
checked: model.submit
onClicked: {
phoneModel.get(model.index).submit = checked
}
}
}
model: ListModel {
id: phoneModel
ListElement {name: "iPhone 5"; cost: "4900"; manufacturer: "Apple"; submit: false}
ListElement {name: "Galaxy S5"; cost: "4699"; manufacturer: "Samsung"; submit: true}
}
}
访问photoModel就知道了,想不出tableView访问radioButton的方法
|
|