Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Method or Function to load a ComboBox model dynamically ?

$
0
0
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?

Viewing all articles
Browse latest Browse all 4972

Latest Images

Trending Articles



Latest Images