Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved QAbstractTableModel incrementat fetching

    General and Desktop
    3
    7
    1295
    Loading More Posts
    • 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
      Qt Enthusiast last edited by

      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 Reply Quote 0
      • VRonin
        VRonin last edited by

        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 Reply Quote 1
        • Q
          Qt Enthusiast last edited by

          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 Reply Quote 0
          • VRonin
            VRonin last edited by

            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 Reply Quote 1
            • Q
              Qt Enthusiast last edited by Qt Enthusiast

              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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 1
                • Q
                  Qt Enthusiast last edited by Qt Enthusiast

                  any hint on implimenting the same will be helpful

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post