ComboBox with many items (Countries)
QML and Qt Quick
5
Posts
2
Posters
2.7k
Views
1
Watching
-
Over a hundred countries in a ComboBox element will create a slow and insanely big list when the dropdown is opened. Hot to show only 5 items in the list with a scrollbar?
And as a bonus: how to make the ComboBox editable? So the user can select a country by typing?
-
sorry, didn't see that you want it in qml. Did you see that: "example":http://qt.gitorious.org/qt-components/qt-components/source/55b123e52c9975e089c1d936e0b05467779dd00e:ComboBox.qml ?
i mean this parts of code:
@
...
property int elementsToShow: 5;
...
Item {
...
height: Math.min(background.height * elements.count,
background.height * combobox.elementsToShow);
//for combobox size
....
Keys.onPressed: {
... //for selecting by typing
}
}
@