diff options
author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2013-05-22 13:33:43 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-23 08:30:05 +0200 |
commit | c5d6d214f964eb4f3f582c0cd7ab6fed7626f537 (patch) | |
tree | cc93300e5419ae859370c5531748a4a3ada8b7a5 /tests/auto/controls/data/tst_slider.qml | |
parent | d314f546f544384b7716ba5dc59ddfc56fa10e48 (diff) | |
download | qtquickcontrols-c5d6d214f964eb4f3f582c0cd7ab6fed7626f537.tar.gz |
Slider: pressing the handle should not change the slider position
We have to maintain the handle offset until the drag operation
has ended. If the user clicks outside the handle, we center
on the cursor position as before.
Task-number: QTBUG-31042
Change-Id: I8f23d998774278c6353d31b6fffea54596f7158e
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_slider.qml')
-rw-r--r-- | tests/auto/controls/data/tst_slider.qml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml index f414e518..96b4d422 100644 --- a/tests/auto/controls/data/tst_slider.qml +++ b/tests/auto/controls/data/tst_slider.qml @@ -268,5 +268,19 @@ Item { compare(spy.count, 5) control.destroy() } + + function test_sliderOffset() { + var control = Qt.createQmlObject('import QtQuick.Controls 1.0; Slider {x: 20; y: 20; width: 100; height: 50}', container, '') + // Don't move slider value if mouse is inside handle regtion + mouseClick(control, control.width/2, control.height/2) + compare(control.value, 0.5) + mouseClick(control, control.width/2 + 5, control.height/2) + compare(control.value, 0.5) + mouseClick(control, control.width/2 - 5, control.height/2) + compare(control.value, 0.5) + mouseClick(control, control.width/2 + 25, control.height/2) + verify(control.value > 0.5) + control.destroy() + } } } |