QTableView is extremely slow (even for only 3000 rows)

后端 未结 8 949
北海茫月
北海茫月 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:58

    Watch out for setSectionResizeMode(). This had enormous performance implications for me. It causes row and column size recalculations with every modification (i.e. every setData()/setText() call). This wasn't noticeable until I reached 1000+ rows. Consider using resizeSections() instead which seems to be a one time adjustment.

提交回复
热议问题