QML ComboBox does not display the current item text of its model...
-
I'm using a ComboBox object to display data from a C++ model.
The Combobox model is stuck to a QQmlListProperty<MyObject>.
It looks like:ComboBox { id: cbSubtitles model: mediaPlayer.subtitleStreams textRole: "title" implicitHeight: 25 Layout.alignment: Qt.AlignLeft Layout.leftMargin: 5 font.pointSize: 8 enabled: true }
The subtitleStreams model is a QQmlListProperty().
I can feed the list with data, it works.
However, at first sight, nothing is displayed in the combobox. I mean , the current element.
I have to drop-down the combobox one time to have all entries displayed and finally the current element.Is there something I missed ?
Karim
-
I'm using a ComboBox object to display data from a C++ model.
The Combobox model is stuck to a QQmlListProperty<MyObject>.
It looks like:ComboBox { id: cbSubtitles model: mediaPlayer.subtitleStreams textRole: "title" implicitHeight: 25 Layout.alignment: Qt.AlignLeft Layout.leftMargin: 5 font.pointSize: 8 enabled: true }
The subtitleStreams model is a QQmlListProperty().
I can feed the list with data, it works.
However, at first sight, nothing is displayed in the combobox. I mean , the current element.
I have to drop-down the combobox one time to have all entries displayed and finally the current element.Is there something I missed ?
Karim