【发布时间】:2020-10-03 10:33:17
【问题描述】:
我在Column 中有一组按钮,我设置了autoExclusive : true。现在只能按预期检查一个按钮。但是,如果我单击已选中的按钮,如何禁用选中状态?以下是代码:
Column {
id: column
Button {
checked: true
text: qsTr("button 1")
autoExclusive : true
checkable : true
background: Rectangle {
color:checked ? "red" : "white"
}
}
Button {
checked: true
text: qsTr("button 2")
autoExclusive : true
checkable : true
background: Rectangle {
color:checked ? "red" : "white"
}
}
Button {
checked: true
text: qsTr("button 3")
autoExclusive : true
checkable : true
background: Rectangle {
color:checked ? "red" : "white"
}
}
}
【问题讨论】: