Results 1 to 2 of 2

Thread: Lazy population of QAbstractTableModel

  1. #1
    Join Date
    Jul 2011
    Posts
    42
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Lazy population of QAbstractTableModel

    Hi, i need to display a huge collection of files in a QTableView, but i dont want to load it entirely into memory. I'd would be nice to add items as the QTableView scrolls down or up. How could i do that? i've been googling but i didnt found anything on lazzy population o tables.

    What should i do to add items to the model only when the view needs them? When scrolling down should i discard the first rows, and ask for them again when scrolling up?

    The data is stored in a IR system.

    Thanks!

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Lazy population of QAbstractTableModel

    I think you need to look at QAbstractItemModel::canFetchMore() and fetchMore()

    Those methods are designed for incremental filling of a model.

Similar Threads

  1. Non-greedy (lazy) RegExp in QtScript
    By ultr in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2010, 15:40
  2. Replies: 4
    Last Post: 7th May 2010, 03:13
  3. QStandardItemModel Lazy Population
    By AaronMK in forum Qt Programming
    Replies: 0
    Last Post: 15th September 2009, 08:05
  4. Replies: 1
    Last Post: 9th August 2009, 19:51
  5. Lazy population of QAbstractModel
    By bastien in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2009, 20:25

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.