How to get visible delegates in a GridView
-
Hello,
is there a way to find out the current visible elements within a GridView?
I found different ways for elements within a ListView but I do not get it work with a GridView.
Not tested code for ListView:
property bool isOutBoundaries : (y > ListView.view.contentBottom || y + height < ListView.view.contentY)
property bool isVisible : (((index * height) >= ListView.view.contentY &&
(index * height) <= ListView.view.contentBottom) ||
((index * height) + height >= ListView.view.contentY &&
(index * height) + height <= ListView.view.contentBottom))
onIsVisibleChanged: { if (isVisible && ListView.view.moving) triggerSomeAction(); }
In following code snippet from my GridView how can I get a reference to "GridView.view" within the MediaItemsGridDelegate component?
GridView {
id: gridview
...
delegate:
MediaItemsGridDelegate {
id: delegateItem
}
}