QTableView performance degredation with lots of items

  • Hey All,

    I searched a little online, but haven’t found a definitive answer for this problem. Pretty much i have a database that is being appended with 100 items/s roughly. (1 item at a time). I'm querying the DB and loading those items into a QSqlModel and QSortFilterProxyModel then displaying in a QTableView. It'll update nice and snappy up to about 4000 items, after that the refresh rate is begging to slow down quite a bit. They querying speeds are fine, I'm printing out a debug line with rowcount of the model which never slows down, so i believe the problem is with displaying.

    Some suggestions i have tried have been swapping it out for a QTreeView with fixed row height which actually turned out to be slower.

    I set tableview->resizeRowtoContents(0) which seemed to help a little.

    Aside from that i haven’t found much of anything that dramatically improves performance.

    I was also thinking that i could hide the majority of the rows till i scroll down then it'll fetch more, but you can only hide one row at a time and this might degrade performance further if i'm constantly looping to hide rows 100 times a second.

    I feel like there is a simpler solution though. 5000 items is arguably not that much. Please let me know if y'all have any ideas.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.