You can do this inline by:
ComboBox {
model: [ "item1,item2,item3" ]
}
But I’d like to be able to do something more like:
VisualItemModel {
id: itemModel
Thing { myComboModelString: "item1,item2,item3" }
}
ListView {
anchors.fill: parent
model: itemModel
}
----
Thing.qml
Rectangle {
id: thing
property string myComboModelString
ComboBox {
model: myComboModelString
}
}
So is there a method or function I’m missing that will take a delimited string and load a model? Or do I have to create a function in either QML/C++ myself to accomplish this?
↧








