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 performance degredation with lots of items
Qt 6.11 is out! See what's new in the release blog

QTableView performance degredation with lots of items

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 936 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.
  • mister_mM Offline
    mister_mM Offline
    mister_m
    wrote on last edited by
    #1

    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.

    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