How can I remove the column with index numbers in QTableWidget
?
The major difference between the two is that QTableView requires you to use an external class derived from QAbstractItemModel with it. The rowCount(), columnCount(), and data() methods for the item model are used by the table view to tell it how to fill in and format the table cells.
About the content of table, you can use QTableWidget::clear to clear. But the table header, you should reset or delete them. you can use takeHorizontalHeaderItem(int column) to take header item, and then to delete it.
Not quite obvious, there are two views the vertical and the horizontal header, they are defined in QTableView
, as any widget you can hide them so its
myTableWidget->verticalHeader()->setVisible(false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With