aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-05 15:57:47 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-06 08:40:09 +0000
commitd03c8de38f5838c237b8c2fb50739d770c5fc14e (patch)
treebbeae02272484eb5b2a3710e96032a3f74a8de22 /tests/auto
parent405ef2c0524e6b9b0236bc5d7c0e6e5ed5c82fe8 (diff)
Add QQuickDial::live
[ChangeLog][Controls][Dial] Added a live-property that determines whether the dial provides live updates for the value-property while the handle is dragged. Change-Id: I8da1190df1e9093f81271a8e11f2cea55759573f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/controls/data/tst_dial.qml18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/auto/controls/data/tst_dial.qml b/tests/auto/controls/data/tst_dial.qml
index e6446d3e..6dd65593 100644
--- a/tests/auto/controls/data/tst_dial.qml
+++ b/tests/auto/controls/data/tst_dial.qml
@@ -172,9 +172,10 @@ TestCase {
function test_dragging_data() {
return [
- { tag: "default", from: 0, to: 1, leftValue: 0.20, topValue: 0.5, rightValue: 0.8, bottomValue: 1.0 },
- { tag: "scaled2", from: 0, to: 2, leftValue: 0.4, topValue: 1.0, rightValue: 1.6, bottomValue: 2.0 },
- { tag: "scaled1", from: -1, to: 0, leftValue: -0.8, topValue: -0.5, rightValue: -0.2, bottomValue: 0.0 }
+ { tag: "default", from: 0, to: 1, leftValue: 0.20, topValue: 0.5, rightValue: 0.8, bottomValue: 1.0, live: false },
+ { tag: "scaled2", from: 0, to: 2, leftValue: 0.4, topValue: 1.0, rightValue: 1.6, bottomValue: 2.0, live: false },
+ { tag: "scaled1", from: -1, to: 0, leftValue: -0.8, topValue: -0.5, rightValue: -0.2, bottomValue: 0.0, live: false },
+ { tag: "live", from: 0, to: 1, leftValue: 0.20, topValue: 0.5, rightValue: 0.8, bottomValue: 1.0, live: true }
]
}
@@ -183,32 +184,35 @@ TestCase {
verify(dial.wrap);
dial.from = data.from;
dial.to = data.to;
+ dial.live = data.live;
valueSpy.target = dial;
verify(valueSpy.valid);
+ var minimumExpectedValueCount = data.live ? 2 : 1;
+
// drag to the left
mouseDrag(dial, dial.width / 2, dial.height / 2, -dial.width / 2, 0, Qt.LeftButton);
fuzzyCompare(dial.value, data.leftValue, 0.1);
- verify(valueSpy.count > 0);
+ verify(valueSpy.count >= minimumExpectedValueCount);
valueSpy.clear();
// drag to the top
mouseDrag(dial, dial.width / 2, dial.height / 2, 0, -dial.height / 2, Qt.LeftButton);
fuzzyCompare(dial.value, data.topValue, 0.1);
- verify(valueSpy.count > 0);
+ verify(valueSpy.count >= minimumExpectedValueCount);
valueSpy.clear();
// drag to the right
mouseDrag(dial, dial.width / 2, dial.height / 2, dial.width / 2, 0, Qt.LeftButton);
fuzzyCompare(dial.value, data.rightValue, 0.1);
- verify(valueSpy.count > 0);
+ verify(valueSpy.count >= minimumExpectedValueCount);
valueSpy.clear();
// drag to the bottom (* 0.6 to ensure we don't go over to the minimum position)
mouseDrag(dial, dial.width / 2, dial.height / 2, 10, dial.height / 2, Qt.LeftButton);
fuzzyCompare(dial.value, data.bottomValue, 0.1);
- verify(valueSpy.count > 0);
+ verify(valueSpy.count >= minimumExpectedValueCount);
valueSpy.clear();
}