This commit is contained in:
朱子楚\zhuzi 2024-05-07 22:16:42 +08:00
parent b916221d9f
commit 655eff4f62
3 changed files with 9 additions and 17 deletions

View File

@ -164,7 +164,7 @@ FluScrollablePage{
verticalCenter: parent.verticalCenter
left: parent.left
}
currentIndex: 1
currentIndex: -1
FluCheckBox{
disabled: radio_button_switch4.checked
text: qsTr("Radio Button_1")

View File

@ -18,7 +18,9 @@ Item{
for(var i = 0;i<buttons.length;i++){
buttons[i].checked = false
}
buttons[currentIndex].checked = true
if(currentIndex>=0 && currentIndex<buttons.length){
buttons[currentIndex].checked = true
}
}
}
implicitWidth: childrenRect.width
@ -42,9 +44,6 @@ Item{
}
}
}
if(control.currentIndex < 0){
control.currentIndex = 0
}
d.updateChecked()
}
}
@ -52,7 +51,7 @@ Item{
Component{
id:com_horizontal
RowLayout {
data: buttons
data: control.buttons
spacing: control.spacing
Component.onCompleted: {
for(var i = 0;i<control.buttons.length;i++){
@ -65,9 +64,6 @@ Item{
}
}
}
if(control.currentIndex < 0){
control.currentIndex = 0
}
d.updateChecked()
}
}

View File

@ -19,7 +19,9 @@ Item{
for(var i = 0;i<buttons.length;i++){
buttons[i].checked = false
}
buttons[currentIndex].checked = true
if(currentIndex>=0 && currentIndex<buttons.length){
buttons[currentIndex].checked = true
}
}
}
implicitWidth: childrenRect.width
@ -43,9 +45,6 @@ Item{
}
}
}
if(control.currentIndex < 0){
control.currentIndex = 0
}
d.updateChecked()
}
}
@ -53,7 +52,7 @@ Item{
Component{
id:com_horizontal
RowLayout {
data: buttons
data: control.buttons
spacing: control.spacing
Component.onCompleted: {
for(var i = 0;i<control.buttons.length;i++){
@ -66,9 +65,6 @@ Item{
}
}
}
if(control.currentIndex < 0){
control.currentIndex = 0
}
d.updateChecked()
}
}