summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_spinbox.qml
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2014-09-16 13:46:43 +0200
committerMitch Curtis <mitch.curtis@digia.com>2014-09-19 11:08:39 +0200
commit85114be06703e7675b6c780776e45c14a69a5c2d (patch)
treeaf846017e18b4b4043f57a556ed727de7e48ea93 /tests/auto/controls/data/tst_spinbox.qml
parent1c40734f87fa10934d7cee430027b478c2ceaf58 (diff)
downloadqtquickcontrols-85114be06703e7675b6c780776e45c14a69a5c2d.tar.gz
SpinBox: intermediate values outside the range are invalid.
When the maximumValue is 100 and the user enters 200, the input will be considered "Intermediate" by QQuickSpinBoxValidator and the value set to 20 when the input is confirmed. This is not how QSpinBox behaves; it prevents any more digits from being entered after the second one. Change-Id: I72490894d0073babda6ed00a0ba081a7ee686fe7 Task-number: QTBUG-40567 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_spinbox.qml')
-rw-r--r--tests/auto/controls/data/tst_spinbox.qml9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_spinbox.qml b/tests/auto/controls/data/tst_spinbox.qml
index 5ce932c7..b22b5a0c 100644
--- a/tests/auto/controls/data/tst_spinbox.qml
+++ b/tests/auto/controls/data/tst_spinbox.qml
@@ -124,6 +124,15 @@ Item {
{tag: "asdf foo", input: [Qt.Key_A, Qt.Key_S, Qt.Key_D, Qt.Key_F, Qt.Key_Space, Qt.Key_F, Qt.Key_O, Qt.Key_O], value: 0},
{tag: "a1b2c3d4e5", input: [Qt.Key_A, Qt.Key_1, Qt.Key_B, Qt.Key_2, Qt.Key_C, Qt.Key_3, Qt.Key_D, Qt.Key_4, Qt.Key_E, Qt.Key_5], value: 1234, maximumValue: 2000},
+
+ {tag: "20", input: [Qt.Key_2, Qt.Key_0, Qt.Key_Return], value: 2, maximumValue: 10},
+ {tag: "200", input: [Qt.Key_2, Qt.Key_0, Qt.Key_0, Qt.Key_Return], value: 20, maximumValue: 100},
+ {tag: "2000", input: [Qt.Key_2, Qt.Key_0, Qt.Key_0, Qt.Key_0, Qt.Key_Return], value: 200, maximumValue: 1000},
+ {tag: "0123", input: [Qt.Key_0, Qt.Key_1, Qt.Key_2, Qt.Key_3, Qt.Key_Return], value: 123, maximumValue: 150},
+ {tag: "-20", input: [Qt.Key_Minus, Qt.Key_2, Qt.Key_0, Qt.Key_Return], value: -2, minimumValue: -10},
+ {tag: "-200", input: [Qt.Key_Minus, Qt.Key_2, Qt.Key_0, Qt.Key_0, Qt.Key_Return], value: -20, minimumValue: -100},
+ {tag: "-2000", input: [Qt.Key_Minus, Qt.Key_2, Qt.Key_0, Qt.Key_0, Qt.Key_0, Qt.Key_Return], value: -200, minimumValue: -1000},
+ {tag: "-0123", input: [Qt.Key_Minus, Qt.Key_0, Qt.Key_1, Qt.Key_2, Qt.Key_3, Qt.Key_Return], value: -123, minimumValue: -150}
]
}