summaryrefslogtreecommitdiffstats
path: root/src/controls/Slider.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-06-04 11:03:39 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-04 11:53:11 +0200
commit1c7d06f2696465993d63a33bf4144f49f02552bc (patch)
treed6966462e67846834cc02f7dc65f38763264a57a /src/controls/Slider.qml
parent8db84cb14a049ff27ccc5893517d8c5ffe0fd636 (diff)
Fix warning in Slider when stepSize is set
Also adding a new test for stepSize Task-number: QTBUG-31441 Change-Id: Ib8d9cc2188b5f73b6b0ac866ade1a7edb1d662b7 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Diffstat (limited to 'src/controls/Slider.qml')
-rw-r--r--src/controls/Slider.qml16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/controls/Slider.qml b/src/controls/Slider.qml
index b31d4f78d..e7e491515 100644
--- a/src/controls/Slider.qml
+++ b/src/controls/Slider.qml
@@ -197,6 +197,14 @@ Control {
anchors.horizontalCenter: !__horizontal ? parent.horizontalCenter : undefined
width: __panel.handleWidth
height: __panel.handleHeight
+
+ function updatePos() {
+ if (updateValueWhileDragging && !mouseArea.drag.active)
+ range.position = __horizontal ? x : y
+ }
+
+ onXChanged: updatePos();
+ onYChanged: updatePos();
}
MouseArea {
@@ -247,14 +255,6 @@ Control {
}
}
- // Range position normally follows handle, except when
- // 'updateValueWhileDragging' is false.
- Binding {
- when: updateValueWhileDragging && !mouseArea.drag.active
- target: range
- property: "position"
- value: __horizontal ? fakeHandle.x : fakeHandle.y
- }
// During the drag, we simply ignore the position set from the range, this
// means that setting a value while dragging will not "interrupt" the