summaryrefslogtreecommitdiffstats
path: root/examples/declarative/slideswitch
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/slideswitch')
-rw-r--r--examples/declarative/slideswitch/Switch.qml9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/declarative/slideswitch/Switch.qml b/examples/declarative/slideswitch/Switch.qml
index a3f75e8..6777277 100644
--- a/examples/declarative/slideswitch/Switch.qml
+++ b/examples/declarative/slideswitch/Switch.qml
@@ -2,9 +2,9 @@ Item {
id: Switch
width: Groove.width
height: Groove.height
- properties: Property {
- name: "on"
- }
+
+ property var on
+
Script {
function toggle() {
@@ -14,7 +14,6 @@ Item {
Switch.state = "On";
}
function dorelease() {
- print(Knob.x);
if(Knob.x == 1) {
if(Switch.state == "Off")
return;
@@ -46,7 +45,7 @@ Item {
MouseRegion {
anchors.fill: Knob
onClicked: { toggle() }
- onReleased: { if (!isClick) dorelease() }
+ onReleased: { dorelease() }
drag.target: Knob
drag.axis: "x"
drag.xmin: 1