aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_rangeslider.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-05 15:36:31 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-06 08:40:05 +0000
commit405ef2c0524e6b9b0236bc5d7c0e6e5ed5c82fe8 (patch)
tree6567e68b8eba596418d2aebf4917541eed1130b6 /tests/auto/controls/data/tst_rangeslider.qml
parent47736b3510696ad3fdff1e9460938f29435261f2 (diff)
Add QQuickRangeSlider::live
[ChangeLog][Controls][RangeSlider] Added a live-property that determines whether the range slider provides live updates for the first.value and second.value properties while the respective handle is dragged. Change-Id: I44d1924078969a5e22aca55625967dd8b5a4abac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_rangeslider.qml')
-rw-r--r--tests/auto/controls/data/tst_rangeslider.qml12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/auto/controls/data/tst_rangeslider.qml b/tests/auto/controls/data/tst_rangeslider.qml
index 392be018..f9e027d4 100644
--- a/tests/auto/controls/data/tst_rangeslider.qml
+++ b/tests/auto/controls/data/tst_rangeslider.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
@@ -294,13 +294,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 = sliderComponent.createObject(testCase, { orientation: data.orientation })
+ var control = sliderComponent.createObject(testCase, { orientation: data.orientation, live: data.live })
verify(control)
firstPressedSpy.target = control.first
@@ -386,7 +388,7 @@ TestCase {
compare(firstPressedSpy.count, 5)
compare(secondPressedSpy.count, 2)
compare(control.first.pressed, true)
- compare(control.first.value, 0.0)
+ compare(control.first.value, data.live ? 0.5 : 0.0)
compare(control.first.position, 0.5)
compare(control.first.visualPosition, 0.5)
compare(control.second.pressed, false)