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. GridView yPosition changes when sorting
Forum Updated to NodeBB v4.3 + New Features

GridView yPosition changes when sorting

Scheduled Pinned Locked Moved QML and Qt Quick
gridviewsortingflickable
1 Posts 1 Posters 734 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.
  • P Offline
    P Offline
    pholz
    wrote on last edited by
    #1

    I have a GridView (LtoR flow) that is sorted dynamically via a QSortFilterProxyModel. The GridView has 100 tiles at all times. I scroll down until visibleArea.yPosition is at e.g. 0.7 (70%). I wait for the model to update, causing the tiles to reorder. Since the nr of tiles doesn't change, I'd expect visibleArea.yPosition to stay at 0.7 - but it doesn't. It changes to other values (I can't really figure out a pattern). Likewise, originY changes.

    This means, for example, that if I scroll to the end of the grid and wait for a bit, I might actually be looking at the beginning of the grid after a while, due to these changes. I tried setting visibleArea.yPosition to the value it had at the end of the last user interaction whenever the data changes, but QML tells me that the property is read-only.

    Why does the scroll position of the GridView jump around like this, and how can I stop it?

    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