How can I remove the column with index numbers in QTableWidget
?
Asked
Active
Viewed 1.9k times
21
2 Answers
42
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);

Harald Scheirich
- 9,676
- 29
- 53
-
My horizontal header is sometimes 4 and some times 5. Here i am getting some space if it is 4. How to set with out getting blank space – Sijith May 31 '10 at 11:05
-
I don't quite understand the questions but you can set the size of a section through the interface in QHeaderView::resizeSection(int section, int size), see docs for QHeaderView – Harald Scheirich May 31 '10 at 12:09
4
PyQt6
self.tableWidget.verticalHeader().setVisible(False)
self.tableWidget.horizontalHeader().setVisible(False)

Jack Zero
- 77
- 6