0

I have three RadioButtons in my QML Desktop Application, and when I click one - I want all the others to be unchecked, but once I set them to unchecked, they really become unchecked, but I can't see that until I move the mouse over them. I tried a lot of ways to resolve it, and didn't find any good one. Do you have any way to simulate mouse over event, and then they will shown as unchecked? Help me plizzzzzzzzzzzzz!!! I wrote this code:

property int openSessionCurrentIndex: -1
onOpenSessionCurrentIndexChanged: {
    rbtnHexadecimal1.checked = openSessionCurrentIndex == 0
    rbtnDecimal1.checked = openSessionCurrentIndex == 1
    rbtnString1.checked = openSessionCurrentIndex == 2
}

,and:

RadioButton{
    id:rbtnHexadecimal1
    width: 140
    onClicked:{
        openSessionItem.openSessionCurrentIndex = 0
    }
    text: "Hexadecimal Data"
    anchors.left: parent.left
    checked: true
}
RadioButton{
    id:rbtnDecimal1
    width: 130
    onClicked:{
        openSessionItem.openSessionCurrentIndex = 1
    }
    text: "Decimal Data"
    anchors.left:rbtnHexadecimal1.right
}
RadioButton{
    id:rbtnString1
    width: 140
    onClicked:{
        openSessionItem.openSessionCurrentIndex = 2
    }
    text: "String Data"
    anchors.left:rbtnDecimal1.right
}

shortening, I need a solution so that when a radioButton becomes unchecked - it is shown like this. any idea?Tnx ahead!

air-dex
  • 4,130
  • 2
  • 25
  • 25
user1835297
  • 1,059
  • 2
  • 12
  • 24

1 Answers1

0

You want to use properly the RadioButton platformExclusiveGroup property, instead of any naïve coding solution.

TheHuge_
  • 1,039
  • 17
  • 29
  • Oh, I tried it first of all, but I got an error:"platformExclusiveGroup is not a valid property name". an other idea? – user1835297 Nov 21 '12 at 10:27