PDA

View Full Version : TableView with multiple columns, emit signal when whole row is selected



Talei
25th April 2010, 08:58
Hello,
I have TableView with i.e. 2 columns and n rows.
Currently I write text, via SIGNAL(clicked(QModelIndex)), to row that was clicked. Like this:
4545
But what I want also to implement, is to emit signal when entire row is selected. Like this:
4546

I tried SIGNAL(activated(QModelIndex)) but this is received only when user press enter.

As always thank you for any input/comments.
Best regards

Edit. Ideally I would want to emit signal when number, indicating tablerow number, is clicked (the one on the left side).

norobro
25th April 2010, 23:35
I think what you are looking for is QTableView::verticalHeader() and QHeaderView::sectionClicked(int):


connect(yourTableView->verticalHeader(),SIGNAL(sectionClicked(int)),yourT ableView,SLOT(yourSlot(int)));

Talei
26th April 2010, 05:42
Thank You, that's exactly why I need.
Best regards

babygal
6th October 2010, 09:33
hi Talei,
can you post your solution code?