summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_slider.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-05-22 13:33:43 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-23 08:30:05 +0200
commitc5d6d214f964eb4f3f582c0cd7ab6fed7626f537 (patch)
treecc93300e5419ae859370c5531748a4a3ada8b7a5 /tests/auto/controls/data/tst_slider.qml
parentd314f546f544384b7716ba5dc59ddfc56fa10e48 (diff)
downloadqtquickcontrols-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.qml14
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()
+ }
}
}