How can I edit the text in my combobox?
-
How can I edit the text in my combobox? This is my combobox now:
ComboBox { id: country_loaded width: 200 height: 100 model: ["Belgium", "The Netherlands", "France", "Germany", "Romania", "Poland", "Czech Republic", "Luxembourg"] background: Rectangle { color: mecs_white border.width: 3 border.color: mecs_white radius: 10 } contentItem: Text { text: control.currentText color: "black" font.pointSize: 16 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } }
"ContentItem: Text" doesn't seem to work as my text dissapears:
-
Well, change your
contentItem
to an input control likeTextField
.Look how
ComboBox
is implemented for Material style: https://github.com/qt/qtdeclarative/blob/dev/src/quickcontrols/material/ComboBox.qml