How to delete all rows from QTableWidget

前端 未结 10 1893
自闭症患者
自闭症患者 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:24

    Removes all items not in the headers from the view. This will also remove all selections. The table dimensions stay the same.

    void QTableWidget::clearContents()
    

    Removes all items in the view. This will also remove all selections and headers.

    void QTableWidget::clear()
    

提交回复
热议问题