今天使用到了QT中QTableWidget的清空和删除功能,特地整理出。
如下:
1、void QTableWidget::clear() [slot]
Removes all items in the view. This will also remove all selections and headers.
//清空表格中所有内容(包含表头)。
2、void QTableWidget::clearContents() [slot]
Removes all items not in the headers from the view. This will also remove all selections. The table dimensions stay the same.//清空表格中的内容(不包含表头)。
3、void QTableWidget::removeCellWidget(int row, int column)
//删除表格中的某行中的某列内容。
Removes the widget set on the cell indicated by row and column.
4、void QTableWidget::removeColumn(int column) [slot]
//删除表格中的某列内容。
Removes the column column and all its items from the table.
5、void QTableWidget::removeRow(int row)[slot]
//删除表格中的某行内容。
Removes the row row and all its items from the table
6、QTableWidgetItem * QTableWidget::takeItem(int row, int colu