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

Access data of C++ model from QML?

$
0
0
Hmm, the best way would always be to go through the model i.e define a Q_INVOKABLE function as you mentioned earlier. Other pure QML way would be to interate over the childrens of TableView’s contentItem. I had tested something similar but with ListView as follows: for(var a=0; a<=listView.contentItem.children.length;a++)     console.log(listView.contentItem.children[a].text) This gives the texts of all elements of ListView even if the model is C++ based. May be you can try it for TableView but i have never tried this personally for TableView.

Viewing all articles
Browse latest Browse all 4972

Trending Articles