diff options
Diffstat (limited to 'examples/quickcontrols/gallery/pages/ComboBoxPage.qml')
-rw-r--r-- | examples/quickcontrols/gallery/pages/ComboBoxPage.qml | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/examples/quickcontrols/gallery/pages/ComboBoxPage.qml b/examples/quickcontrols/gallery/pages/ComboBoxPage.qml index 35c3d60d16..075859717e 100644 --- a/examples/quickcontrols/gallery/pages/ComboBoxPage.qml +++ b/examples/quickcontrols/gallery/pages/ComboBoxPage.qml @@ -15,12 +15,12 @@ ScrollablePage { width: parent.width wrapMode: Label.Wrap horizontalAlignment: Qt.AlignHCenter - text: "ComboBox is a combined button and popup list. It presents " - + "a list of options to the user that occupies minimal screen space." + text: qsTr("ComboBox is a combined button and popup list. It presents " + + "a list of options to the user that occupies minimal screen space.") } ComboBox { - model: ["First", "Second", "Third"] + model: [qsTr("First"), qsTr("Second"), qsTr("Third")] anchors.horizontalCenter: parent.horizontalCenter } @@ -28,21 +28,22 @@ ScrollablePage { width: parent.width wrapMode: Label.Wrap horizontalAlignment: Qt.AlignHCenter - text: "ComboBox can be made \l editable. An editable combo box auto-" - + "completes its text based on what is available in the model." + text: qsTr("ComboBox can be made editable. An editable combo box auto-" + + "completes its text based on what is available in the model.") } ComboBox { + id: comboBox + editable: true model: ListModel { - id: model - ListElement { text: "Banana" } - ListElement { text: "Apple" } - ListElement { text: "Coconut" } + ListElement { text: qsTr("Banana") } + ListElement { text: qsTr("Apple") } + ListElement { text: qsTr("Coconut") } } onAccepted: { if (find(editText) === -1) - model.append({text: editText}) + comboBox.model.append({text: comboBox.editText}) } anchors.horizontalCenter: parent.horizontalCenter } |