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

QML ComboBox model from C++

$
0
0
Hey! I have a list from C++ containing language code, language description and a flag for the corresponding country. I made the connection to QML, but cant get to set the model right. I tried different approaches and either I get an empty ComboBox, or I get a ComboBox containing only one alternative, which is “0”. This is the code for the ComboBox:                 ComboBox{                     id: langSelection;                     editable: false;                     width: caText.width;                     model: LanguageList.languageList;                       textRole:{                         if(LanguageList.langList.langCode !== undefined){                             LanguageList.langList.langCode;                         }                       }

Viewing all articles
Browse latest Browse all 4972

Trending Articles