QML - How to use GridView::itemAt(real x, real y)?
Solved
QML and Qt Quick
-
Hi;
I can get item ofRepeater
like this:var item = repeater.itemAt(index);
But how can I get item of
GridView
? I saw itemAt function. But it is different fromitemAt
ofRepeater
. It wantsx
andy
coordinates but we can useindex
inGridView
likeRepeater
. How can I access the item? Thanks. -
-
@raven-worx thanks.
I solved this problem like this:gridView.currentIndex = lastIndex; var lastItem = gridView.currentItem; gridView.currentIndex = currentIndex; var currentItem = gridView.currentItem;