Hi,

I've got a QTableView with five rows and five columns. In the fifth column of each row I have a QToolButton widget which is connected to the click signal and all go to the same slot. My problem is, I need to know which row is selected when the user has clicked on the button.

Qt Code:
  1. connect( button, SIGNAL(clicked()),this,SLOT(SendAMessage()) );
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void CSignal::SendAMessage()
  2. {
  3. // how can I get which row is selected?
  4.  
  5. }
To copy to clipboard, switch view to plain text mode 

I cannot do this :

Qt Code:
  1. connect(ui.tableView, SIGNAL(clicked(QModelIndex)), this, SLOT(GetSelectedRow( QModelIndex )));
To copy to clipboard, switch view to plain text mode 

As the button click event is signalled first.

Any ideas?

Thanks,
Steve