Results 1 to 2 of 2

Thread: canFetchMore() direction?

  1. #1
    Join Date
    Nov 2008
    Posts
    183
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default canFetchMore() direction?

    In looking through the doc it seems canFetchMore() will be called any time hits the "end" of the data it has to display. What isn't clear is how one tells which direction the table is attempting to move. When one has a limited viewport, say 30-100 rows, windowing over a database which is gigs in size, how does canFetchMore() in the model determine which direction it should be checking? I assume the same test will work when fetchMore() is called so it nows which direction to fetch data.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: canFetchMore() direction?

    fetchMore() is meant to grow the model "downwards" (to higher row indices). There is no infrastructure in QAbstractItemView that would require the model to grow "upwards" as it is assumed that when the model is populated, the view shows the beginning of data. When the view is scrolled, the data already populated is kept in memory. What you can do is to provide your own internal cache in the model, only keeping a window of data large enough to populate the view and generate data on the fly as the window (centered around the last accessed index in the model) moves.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to detect a root cause of canfetchmore() ?
    By sedlacek.david in forum Qt Programming
    Replies: 0
    Last Post: 18th October 2014, 21:37
  2. Collision direction
    By Erkki2 in forum Qt Programming
    Replies: 6
    Last Post: 4th November 2013, 15:00
  3. Set application's layout direction
    By vivek.panchal in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2013, 14:58
  4. how the Google maps get direction
    By MKSPulok in forum General Discussion
    Replies: 1
    Last Post: 16th June 2012, 22:52
  5. direction
    By panduro in forum Qt Programming
    Replies: 1
    Last Post: 23rd July 2008, 20:51

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.