Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing index numbers in QTablewidget

Tags:

qt

qt4

qt-creator

How can I remove the column with index numbers in QTableWidget ?

like image 521
Sijith Avatar asked May 31 '10 10:05

Sijith


People also ask

What is the difference between QTableView and 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.

How do you delete a table in Qt?

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.


1 Answers

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);
like image 161
Harald Scheirich Avatar answered Sep 24 '22 18:09

Harald Scheirich