How can I remove the column with index numbers in QTableWidget
?
Removing index numbers in QTablewidget
Asked Answered
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);
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 –
Annalisaannalise
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 –
Antoniaantonie
PyQt6
self.tableWidget.verticalHeader().setVisible(False)
self.tableWidget.horizontalHeader().setVisible(False)
© 2022 - 2024 — McMap. All rights reserved.