Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to get visible delegates in a GridView
Forum Updated to NodeBB v4.3 + New Features

How to get visible delegates in a GridView

Scheduled Pinned Locked Moved QML and Qt Quick
gridview listvi
1 Posts 1 Posters 515 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sk2212
    wrote on last edited by
    #1

    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
    }
    }

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved