Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QAbstractTableModel incrementat fetching
QtWS25 Last Chance

QAbstractTableModel incrementat fetching

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      http://doc.qt.io/qt-5/qtwidgets-itemviews-fetchmore-example.html

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      1
      • Q Offline
        Q Offline
        Qt Enthusiast
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          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

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          1
          • Q Offline
            Q Offline
            Qt Enthusiast
            wrote on last edited by Qt Enthusiast
            #5

            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

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • Q Offline
                Q Offline
                Qt Enthusiast
                wrote on last edited by Qt Enthusiast
                #7

                any hint on implimenting the same will be helpful

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved