How to Remove the Header in QTableView?

New Moon picture New Moon · Sep 10, 2013 · Viewed 10.3k times · Source

As shown in the Image below, How can i remove the unwanted header section ?

QTableView with 4 columns

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).

Answer

Michael Scheper picture Michael Scheper · Jun 23, 2016

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();