aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_spinbox.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-22 14:13:39 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-23 09:26:12 +0000
commit9d32fd6f446844a713d520fe02aa8c5c2104898d (patch)
treebed3c531e4651271619bec74253899f7c5af2b61 /tests/auto/controls/data/tst_spinbox.qml
parent95168d58afb13409c07375eafd6897b4097e4287 (diff)
Add SpinBox::editable property
The default value is false, which is more mobile/embedded/touch friendly choice, and will be also in line with ComboBox::editable when it gets introduced sometime in the future. Change-Id: Iaaad8f5533100c2d5c4b49d1ef8ee849cf31feff Task-number: QTBUG-51114 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data/tst_spinbox.qml')
-rw-r--r--tests/auto/controls/data/tst_spinbox.qml24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_spinbox.qml b/tests/auto/controls/data/tst_spinbox.qml
index cdea8b66..e73c10b6 100644
--- a/tests/auto/controls/data/tst_spinbox.qml
+++ b/tests/auto/controls/data/tst_spinbox.qml
@@ -87,6 +87,7 @@ TestCase {
compare(control.to, 99)
compare(control.value, 0)
compare(control.stepSize, 1)
+ compare(control.editable, false)
compare(control.up.pressed, false)
compare(control.down.pressed, false)
@@ -326,4 +327,27 @@ TestCase {
control.destroy()
}
+
+ function test_editable() {
+ var control = spinBox.createObject(testCase)
+ verify(control)
+
+ control.contentItem.forceActiveFocus()
+ compare(control.contentItem.activeFocus, true)
+
+ compare(control.editable, false)
+ control.contentItem.selectAll()
+ keyClick(Qt.Key_5)
+ keyClick(Qt.Key_Return)
+ compare(control.value, 0)
+
+ control.editable = true
+ compare(control.editable, true)
+ control.contentItem.selectAll()
+ keyClick(Qt.Key_5)
+ keyClick(Qt.Key_Return)
+ compare(control.value, 5)
+
+ control.destroy()
+ }
}