Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
GridView yPosition changes when sorting
pholz last edited by
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.yPositionis 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.yPositionto stay at 0.7 - but it doesn't. It changes to other values (I can't really figure out a pattern). Likewise,
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.yPositionto 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?