QTableView is extremely slow (even for only 3000 rows)

后端 未结 8 958
北海茫月
北海茫月 2021-01-04 11:20

I have a table with 3000 rows and 8 columns. I use the QTableView. To insert items I do:

QStandardItem* vSItem = new QStandardItem();
vSItem->setText(\"Bl         


        
8条回答
  •  爱一瞬间的悲伤
    2021-01-04 11:54

    Good call on the autoresize on contents for your columns or rows.

    I have a function that added a column to the table each time a client connected to my server application. As the number of columns in the table got large, the insertion time seemed to take longer and longer.

    I was doing a ui->messageLog->resizeRowsToContents(); each time. I changed this to only auto resize the row that was being added ui->messageLog->resizeRowToContents(0);, and the slowness went away.

提交回复
热议问题