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");
}
}
}
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");
}
}
}
To copy to clipboard, switch view to plain text mode
Anything else to add, like
states: [
State { name: "state1"; when: sharedCondition },
State { name: "state2"; when: sharedCondition }
]
states: [
State { name: "state1"; when: sharedCondition },
State { name: "state2"; when: sharedCondition }
]
To copy to clipboard, switch view to plain text mode
Bookmarks