diff options
| author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2013-06-04 11:03:39 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-04 11:53:11 +0200 |
| commit | 1c7d06f2696465993d63a33bf4144f49f02552bc (patch) | |
| tree | d6966462e67846834cc02f7dc65f38763264a57a /src/controls/Slider.qml | |
| parent | 8db84cb14a049ff27ccc5893517d8c5ffe0fd636 (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.qml | 16 |
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 |
