Hi,

I want to be able to extract a specific column's data using a row index. For example, my table is populated using an SQL query, when a user selects an item from the table the whole row is highlighted. From this highlighted row, I want to extract the 2nd column row as a String value.

I have the following code/slot for when the table is selected:
Qt Code:
  1. void GUI::receviedIndex( const QModelIndex &index ){
  2.  
  3. QString temp = QString::number(index.row());
  4. QMessageBox::critical(0, QObject::tr("Testing"),temp);
  5. }
To copy to clipboard, switch view to plain text mode 


I've tried a couple of things without success. Can anyone suggest what classes/methods to look at in order to achieve this?

Thanks