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. QTableView defaults to paging? I want all rows at once...
QtWS25 Last Chance

QTableView defaults to paging? I want all rows at once...

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 599 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by davecotter
    #1

    If i load a QTableView with a model that has say 100k items in it, i want the scroll bars to immediately reflect that. Currently the scroll bars only reflect a fraction of that, and when i scroll to the bottom, suddenly more data is added and the scroll thumb jumps out from under my mouse. this is... not a pleasant UX.

    How do i get the QTableView's scroll bars to correctly represent the size of the data?

    update: and wow even worse: if i SORT the data by a column, it only sorts the fraction that's been loaded into the viewer? huh?? it should be sorting the entire dataset, not the tiny bit shown in the view, right?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #5

      that's helpful. hmm. is there a way to ask "how many pages will be returned" so i can put a progress bar on this fetchmore loop?

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

        Hi,

        Any chance you are using a QSqlTableModel ?

        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
        0
        • D Offline
          D Offline
          davecotter
          wrote on last edited by
          #3

          indeed, it is an SQLTableModel

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

            Then you may want to look into its fetchMore method.

            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
            0
            • D Offline
              D Offline
              davecotter
              wrote on last edited by
              #5

              that's helpful. hmm. is there a way to ask "how many pages will be returned" so i can put a progress bar on this fetchmore loop?

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

                I think the quick way would be to do a count query and divide the result by the fetch size.

                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
                • D Offline
                  D Offline
                  davecotter
                  wrote on last edited by
                  #7

                  okay but i don't see anything about fetch size? sorry this is all BRAND new to me

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

                    Based on the implementation, it's currently hardcoded to 255.

                    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
                    0

                    • Login

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