Swich Control - How to get True or false?
Solved
General and Desktop
-
Hi,
I want to get switch state like true or false, Am I doing this right?
Code snippet:
Switch { id: idswitch checked: false onCheckedChanged: { console.log("Switch"); if (idswitch.state == "on") { console.log("toggle - True"); } if (idswitch.state === true) { console.log("toggle - True"); } } }
Anything else to add, like
states: [
State { name: "state1"; when: sharedCondition },
State { name: "state2"; when: sharedCondition }
]