QAbstractTableModel incrementat fetching



  • Hi All,

    I have QAbstractTableModel and I have a mapping of the same table in my database

    Is it possible I get incremental fetching of the table , is it possible I can get all the visible rows in one go and once I scroll down I fetch incremental rows again





  • how to calculate the visible start and end index of QTableView.

    for example if we move the scrollbar and if the visible start index is 10 and visible end index is 15 how to get the same in code



  • I'm not aware of a "mobile window" available out of the box in Qt, what qt implements is lazy loading i.e. load the first lines and load the rest only as it scrolls down but it does not implement a load the next visible row and forget the row above that is now hidden



  • so do you mean to say that if there are 1 million rows in QAbstractTableModel then if when we scroll down till 1 Million's row then will it will ir call ::data for 1 millions rows then it will call ::data for all the rows .will it not be performance issue


  • Lifetime Qt Champion

    Hi,

    It means that the base model / view classes are not implemented to try to be smarter than the developer. If you have a model that might get 1'000'000 entries, you'll likely want to implement your own "mobile window" that won't load more than the necessary data in-memory.



  • any hint on implimenting the same will be helpful


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.