summaryrefslogtreecommitdiff
path: root/tests/manual
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2014-07-18 08:39:12 +0200
committerJ-P Nurmi <jpnurmi@digia.com>2014-07-18 17:37:55 +0200
commit8a13f087d3c0c7b9010b9861890b27a17889aeaa (patch)
treefab8ac15c7b59b2d2df18f985b8e4948c234ccc1 /tests/manual
parent15d7ab65d1b8772a68258573141874d7f5cd2be5 (diff)
downloadqtquickcontrols-8a13f087d3c0c7b9010b9861890b27a17889aeaa.tar.gz
ComboBox: add support for selection handles
Task-number: QTBUG-38934 Change-Id: I0d7bfc821ff345e76d1ae89818f6a5e0120695f5 Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/texthandles/main.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/manual/texthandles/main.qml b/tests/manual/texthandles/main.qml
index c9c21d9f..ab10b861 100644
--- a/tests/manual/texthandles/main.qml
+++ b/tests/manual/texthandles/main.qml
@@ -126,6 +126,33 @@ ApplicationWindow {
}
}
+ ComboBox {
+ id: combobox
+ z: 1
+ editable: true
+ currentIndex: 1
+ Layout.fillWidth: true
+ selectByMouse: selectBox.checked
+ model: ListModel {
+ id: combomodel
+ ListElement { text: "Apple" }
+ ListElement { text: "Banana" }
+ ListElement { text: "Coconut" }
+ ListElement { text: "Orange" }
+ }
+ onAccepted: {
+ if (find(currentText) === -1) {
+ combomodel.append({text: editText})
+ currentIndex = find(editText)
+ }
+ }
+
+ style: ComboBoxStyle {
+ cursorHandle: handleBox.checked ? cursorDelegate : null
+ selectionHandle: handleBox.checked ? selectionDelegate : null
+ }
+ }
+
TextArea {
id: edit
Layout.fillWidth: true