Search code examples
qtqt4qtableview

Number of row not shown in QTableView


I have this table view in which I display some data on 3 columns. I know that each row should automatically be numbered by the table like:

_ column_1 column_2 column_3

1 data_1 data_2 data_3

2 data_1 data_2 data_3

.....

My problem is that the row number doesn't appear. Is there some function that I have to enable?

I tried

table.verticalHeader.show();

But it is not working.


Solution

  • Got it. I re-implemented the headerData function for my table view and somehow there was a conflict between the row numbers and the column headers and the row numbers got obscured. I commented the function and now the row numbers appear.