summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_combobox.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-12-11 18:51:14 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-13 12:02:36 +0100
commit49a7f0b8e544fed6bf7811198d7696af8d7baba9 (patch)
treef01c68e820ac899bf111f2cf2b2a95b6eab90438 /tests/auto/controls/data/tst_combobox.qml
parent29a362c1915f82e8eb89cf9788d2379acb67d24d (diff)
downloadqtquickcontrols-49a7f0b8e544fed6bf7811198d7696af8d7baba9.tar.gz
Make editable Combobox accept substrings
This fixes the issue that onAccepted would not update the currentText or current index if the string was a substring/partial match. Note that the new internal MatchFixedString case matches the complete string in a case insensitive way. [ChangeLog][Qt Quick Controls][Editable Combobox would not update currentText when accepting a substring of an existing value.] Task-number: QTBUG-35521 Change-Id: Ied850208425ae71b2414f1abf9389e9a8ed50cfb Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_combobox.qml')
-rw-r--r--tests/auto/controls/data/tst_combobox.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index 256e213e..f63a6ee7 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -307,6 +307,24 @@ TestCase {
compare(comboBox.editText, "Coco")
compare(comboBox.currentIndex, 1)
+ comboBox.editText = ""
+ keyPress(Qt.Key_C)
+ keyPress(Qt.Key_O)
+ keyPress(Qt.Key_C) // autocompletes "coco"
+ keyPress(Qt.Key_Backspace)
+ keyPress(Qt.Key_Return) // Accept "coc"
+ compare(comboBox.editText, "coc")
+ compare(comboBox.currentText, "coc")
+
+ comboBox.editText = ""
+ keyPress(Qt.Key_C)
+ keyPress(Qt.Key_O)
+ keyPress(Qt.Key_C) // autocompletes "coc"
+ keyPress(Qt.Key_Space)
+ keyPress(Qt.Key_Return) // Accept "coc "
+ compare(comboBox.editText, "coc ")
+ compare(comboBox.currentText, "coc ")
+
comboBox.destroy()
}