How to delete all rows from QTableWidget

前端 未结 10 1891
自闭症患者
自闭症患者 2021-01-31 14:57

I am trying to delete all rows from a QTableWidget . Here is what I tried.

for ( int i = 0; i < mTestTable->rowCount(); ++i )
{
    mTestTable->removeRo         


        
10条回答
  •  悲&欢浪女
    2021-01-31 15:41

    You can just add empty item model (QStandardItemModel) to your QTableView (myTableView):

    itemModel = new QStandardItemModel;
    ui->myTableView->setModel(itemModel);
    

提交回复
热议问题