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. [SOLVED] QTableView
Qt 6.11 is out! See what's new in the release blog

[SOLVED] QTableView

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.3k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    Gundi
    wrote on last edited by
    #1

    Hello all. I have a QTableView and loading records from a SQLite database. Everything has been working fine but now that I have about 1200 records in my database table the QTableView only seems to display 257 records. Does anyone know if there is a max number of rows a QTableView can handle? Thanks in advance.

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

      Hi,

      Have a look a the canFetchMore function. If have more then a given count of row (i don't remember the number exactly) you can call fetchMore based on the information provided by canFetchMore.

      Hope it helps

      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
      • S Offline
        S Offline
        Subst27
        wrote on last edited by
        #3

        for example:

        QSqlTableModel model;

        // init model and so at this point

        QTableView view;

        view.setModel(model);

        model.select();
        while (model.canFetchMore())
        model.fetchMore();

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Gundi
          wrote on last edited by
          #4

          Perfect that worked. Thank you very much

          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