Hi everyone,
I'm quite new in Qt/QML so I still have to learn some basics. Here is my problem on my app.
My app has 2 ListView in qml, my model is "exported" from c++ by setContextProperty. The model is herited from QStandardItemModel and is called StandardQmlModel
My model is a 2 level model. Which means 1 "main" item can have children, and that's it.
So 1 Listview has the model exported from c++,once 1 item is selected from the first listview, the 2nd listview display the children items.
So, in c++ code I did this,
Qt Code:
{ if(idx.isValid()) { if(itm->hasChildren()) { return itm->child(0,0).model(); } } return 0; }To copy to clipboard, switch view to plain text mode
but what I get with this code is the "main" model, or the same model as display in the first ListView.
So my question is : How can I get the sub Model of an item in a view ?
Many thanks
Bounce
Bookmarks