diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-10-04 21:39:57 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-10-05 12:07:26 +0000 |
commit | 47736b3510696ad3fdff1e9460938f29435261f2 (patch) | |
tree | e82bd4a3aba6621a627425c9c3a524b30690daf0 /tests/auto/controls/data/tst_slider.qml | |
parent | ae3e7f0799fcdd094e54d792e1a9b13c0e7730aa (diff) |
Add QQuickSlider::live
[ChangeLog][Controls][Slider] Added a live-property that determines
whether the slider provides live updates for the value-property while
the handle is dragged.
Change-Id: Ib393548f80be4db57a977eac39d5d560ca441f3c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_slider.qml')
-rw-r--r-- | tests/auto/controls/data/tst_slider.qml | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml index f91760e4..2c20f26c 100644 --- a/tests/auto/controls/data/tst_slider.qml +++ b/tests/auto/controls/data/tst_slider.qml @@ -40,7 +40,7 @@ import QtQuick 2.2 import QtTest 1.0 -import QtQuick.Controls 2.1 +import QtQuick.Controls 2.2 TestCase { id: testCase @@ -223,13 +223,15 @@ TestCase { function test_mouse_data() { return [ - { tag: "horizontal", orientation: Qt.Horizontal }, - { tag: "vertical", orientation: Qt.Vertical } + { tag: "horizontal", orientation: Qt.Horizontal, live: false }, + { tag: "vertical", orientation: Qt.Vertical, live: false }, + { tag: "horizontal:live", orientation: Qt.Horizontal, live: true }, + { tag: "vertical:live", orientation: Qt.Vertical, live: true } ] } function test_mouse(data) { - var control = slider.createObject(testCase, {orientation: data.orientation}) + var control = slider.createObject(testCase, {orientation: data.orientation, live: data.live}) verify(control) pressedSpy.target = control @@ -251,8 +253,8 @@ TestCase { mouseMove(control, control.width * 0.5, control.height * 0.5, 0, Qt.LeftButton) compare(pressedSpy.count, 1) compare(control.pressed, true) - compare(control.value, 0.0) - verify(control.position, 0.5) + compare(control.value, data.live ? 0.5 : 0.0) + compare(control.position, 0.5) mouseRelease(control, control.width * 0.5, control.height * 0.5, Qt.LeftButton) compare(pressedSpy.count, 2) @@ -270,13 +272,13 @@ TestCase { mouseMove(control, control.width * 2, -control.height, 0, Qt.LeftButton) compare(pressedSpy.count, 3) compare(control.pressed, true) - compare(control.value, 0.5) + compare(control.value, data.live ? 1.0 : 0.5) compare(control.position, 1.0) mouseMove(control, control.width * 0.75, control.height * 0.25, 0, Qt.LeftButton) compare(pressedSpy.count, 3) compare(control.pressed, true) - compare(control.value, 0.5) + compare(control.value, data.live ? control.position : 0.5) verify(control.position >= 0.75) mouseRelease(control, control.width * 0.25, control.height * 0.75, Qt.LeftButton) |