Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57999

Make QAbstractListModel/QAbstractItemModel as Endless

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P5: Not important P5: Not important
    • None
    • 5.7.1
    • Widgets: Itemviews
    • None

      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.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            seyed_m S.M.Mousavi
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes