use QAbstractListModel(c++) class in QML ComboBox
Solved
QML and Qt Quick
-
What's the type of
cplusplusModel.modelList
?
Can you show the header ? -
Not sure what is your model implementation.
Here is the simple thing which works
ComboBox { model: myModel textRole: "name" } QQmlApplicationEngine engine; engine.rootContext()->setContextProperty("myModel",&myModel); engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
myModel is inherited from QAbstractListModel. name role is defined in the model.
Can you share you model implementation ?
-