Hi all,
I'm quite newbie with QML.
I'm managing the focus changing (by tab/back-tab) on all my application.
I was able to manage it for all my items except for the ListView.
When tab is hit, in my listView I want to do something like:
[...]
var firstElement = getFirstElement();
firstElement.forceActiveFocus();
[...]
[...]
var firstElement = getFirstElement();
firstElement.forceActiveFocus();
[...]
To copy to clipboard, switch view to plain text mode
I don't want to use currentIndex if possible because I'm trying to use common APIs for all components. I want a way to get the element.
In my code the problem is the function called "getFirstElement".
I've tried to get the element by
listView.children[0].children[0]
listView.children[0].children[0]
To copy to clipboard, switch view to plain text mode
but don't works because "listView.children[0].children" is not aligned to the model. I've read that ListView loads the internal element dynamically.. therefore the index 0 is not the first element but only the first visible list element.
I also tried to store the listView children when component is loaded but the problem is that in that moment are loaded only visible list elements.
In other words what I need would be: how can I get a complete list of all the elements of the ListView?
is there a way to get it?
thank you
Bookmarks