Qt 6.12 LTS is out! See what's new in the release
blog
Blocking the ListView position when refreshing the model
-
Hi,
I have a QListView with a ScrollBar in a Qml application. The model is refreshed every 2 seconds. Whenever it is updated, the list view is reset to the top. How to make the position of view not change? The number of elements in the model is unchanged. -
Since the model is refreshing you can try to remember current index & set the currentIndex every time you reset the model.
-
What is the type of the model? How is it refreshed?
You should use a proper
QAbstractListModelif you have a dynamic model.