tags:

views:

42

answers:

1

Hi.,

i am new QT. i used QTableView. Please see the picture.

http://i.imgur.com/BTtO7.png

in the image left side it's automatically putting row number. i noted in Red color. i need to remove the entire column. how to do that.

next my problem is, if i click any cell, only that cell selecting. i need to select entire row ,like i noted in pink color. example if i click the " testApp-copy.itr" cell then the entire should select.

Please help me to fix this.

+2  A: 

http://doc.trolltech.com/4.6/qtableview.html#hideColumn

possibly table.hideColumn(0)? Try it.

or table.verticalHeader().hide();


Update: I have checked at it is

table->verticalHeader()->hide();

to get the vertical header and hide it. And

table->setSelectionBehavior(QAbstractItemView::SelectRows);

to select whole rows. You may also want to specify the selection mode.

Roman A. Taycher
The documentation makes it look like table.setSelectionBehavior(QAbstractItemView::SelectRows) is what you want to select a whole row.
Roman A. Taycher