QTableView is extremely slow (even for only 3000 rows)

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

    I found a solution: the problem was that I assigned the model to the tableview already in the constructor. So everytime I inserted the item in the model, tableview was informed and probably updated. Now I assign the model to the tableview only after I filled my model with data. This is not an elegant solution but it works. Is there maybe a way to temporarily disable the model from tableview or something that says to the tableview to not to care about changes in the model?

提交回复
热议问题