当重新载入tableWidget表格内容时,通常需要删除先前显示在tableWidget窗口中的表格内容。这时我们只需要将tableWidget的行数重新定义为0行就行了。 self.tableWidget.setRowCount(0)