Essentially, I have a regular ListView:
Rectangle { id: mylist ListModel { id: mylistModel ListElement { text: "blah1" } ListElement { text: "blah2" } ListElement { text: "blah3" } } Component { id: mylistDelegate Text { id: mylistDelegateText text: text property bool mylistDelegateTextEnabled: false } } ListView { id: mylistView model: mylistModel delegate: mylistDelegate } }
Please ignore any issues that I might introduce by truncating the code to focus on what is important.
Anyway, now the problem is that I want to access the assigned delegate ListElement and see that the value mylistDelegateTextEnabled is in the javascript loop. For example, this loop iterates over the current list and gives me the text ListElements in the model:
for(var i = 0; i < mylistModel.count; ++i) { console.log(mylistModel.get(i).text); }
This obviously works great.
Now I want essentially the following:
for(var i = 0; i < mylistModel.count; ++i) { console.log(mylistModel.get(i).text); console.log(mylistModel.get(i).delegate.mylistDelegateTextEnabled); }
Alas, that is not so simple.
Help evaluate.
source share