diff options
author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2013-05-21 16:28:06 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-22 11:35:46 +0200 |
commit | dedc113593d4d7d0e9d500800bc06b89649d5cfe (patch) | |
tree | 217f3bb82ffee4ab5acc643e8467827050dc7caf /tests/auto/controls/data/tst_slider.qml | |
parent | 403ceea1d0d6b1cab50bb024816173f1ead9db42 (diff) | |
download | qtquickcontrols-dedc113593d4d7d0e9d500800bc06b89649d5cfe.tar.gz |
Fix various issues with slider
- Fixed missing press appearance of slider handle
- Removed drag threshold when pulling handle
- Ensure handle stays connected to mouse cursor by giving the fake handle size
Task-number: QTBUG-31042
Change-Id: I289a48b5fa67dde2792590645b8630a7ae6518d9
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_slider.qml')
-rw-r--r-- | tests/auto/controls/data/tst_slider.qml | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml index 7c07ba4c..f414e518 100644 --- a/tests/auto/controls/data/tst_slider.qml +++ b/tests/auto/controls/data/tst_slider.qml @@ -127,7 +127,7 @@ Item { var ratio = mouseRatio / sliderDeltaRatio mouseWheel(slider, 5, 5, 20 * ratio, 0) - compare(slider.value, 20) + compare(slider.value, 22) slider.maximumValue = 30 slider.minimumValue = 0 @@ -238,7 +238,15 @@ Item { } function test_updateValueWhileDragging() { - var control = Qt.createQmlObject('import QtQuick.Controls 1.0; Slider {x: 0; y: 0; width: 200; height: 50}', container, '') + var controlString = + 'import QtQuick 2.1 ; \ + import QtQuick.Controls 1.0 ; \ + import QtQuick.Controls.Styles 1.0; \ + Slider { \ + width: 200 ; \ + height : 50; \ + style: SliderStyle{ handle: Item{ } }}' + var control = Qt.createQmlObject(controlString, container, '') control.maximumValue = 200 control.minimumValue = 0 control.stepSize = 0.1 @@ -249,14 +257,15 @@ Item { spy.signalName = "valueChanged" control.updateValueWhileDragging = false - mouseDrag(control, 0,1, 100 + util.dragThreshold + 1 , 0, Qt.LeftButton) + mouseDrag(control, 0,1, 100 , 0, Qt.LeftButton) compare(control.value, 100) compare(spy.count, 1) control.updateValueWhileDragging = true - mouseDrag(control, 100,1, 80 + util.dragThreshold + 1 , 0, Qt.LeftButton) + + mouseDrag(control, 100,1, 80 , 0, Qt.LeftButton) compare(control.value, 180) - compare(spy.count, 4) + compare(spy.count, 5) control.destroy() } } |