Mathan
10th October 2016, 11:29
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 }
]
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 }
]