Details
-
Suggestion
-
Resolution: Unresolved
-
P5: Not important
-
None
-
5.7.1
-
None
Description
In QAbstractItemModel we can use fetchMore() and canFetchMore() for incremental loading model.
But in order to better memory management and faster startup, we can clear earlier data elements and loads them whenever needed.
Currently I implemented an simple Model based on QAbstractListModel with my own methods. Model loads more data elements whenever an threshold be reached and then removes old ones from opposite side. So total buffer size remains fixed. Also I chose threshold as 0.25 of total buffer size for less need to fetching more data. I guess that you can implement better strategy in a more efficient way.
With millions of data elements which loads over time and unloads old data elements, memory usage is good, startup is fast and scrolling is smooth.
So I suggest you to extend fetchMore() method/functionality of the QAbstractItemModel to support two direction loading data and furthermore remove old one.