As shown in the Image below, How can i remove the unwanted header section ?
My Table has to display only 4 column headers. It should not display the whole header section. Please Help to remove the Header Section which is displaying after the 4th column (Header section which is highlighted).
From your comments in the other answer, I wonder if, by 'it should not display the whole header section', you mean you want to remove the header altogether.
If so, here's how:
myTable->horizontalHeader()->hide();
You can stretch the last column to take all the avaiable space using the stretchLastSection property:
myTable->horizontalHeader()->setStretchLastSection(true);
Or you can hide it with a stylesheet:
myTable->setStyleSheet("QHeaderView {background-color: transparent;}");
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