Nominate our 2022 Qt Champions!

[SOLVED] QTableView

  • 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.

  • Lifetime Qt Champion


    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

  • for example:

    QSqlTableModel model;

    // init model and so at this point

    QTableView view;

    while (model.canFetchMore())

  • Perfect that worked. Thank you very much

Log in to reply