Quote Originally Posted by spirit View Post
Qt Code:
  1. QString email = index.data(Qt::EditRole).toString();
To copy to clipboard, switch view to plain text mode 

PS. please, use tags code.
Thanks a lot for the quick answer.
If I use your code I get the content of the cell I clicked, but I want get the Id (from the database) of the row I clicked
this is the table

Da | Soggetto | Data

and this is the query

Qt Code:
  1. QSqlQuery query("SELECT email.id,addresses.name,email.subject,email.date FROM email,addresses WHERE addresses.id=email.'from'");
To copy to clipboard, switch view to plain text mode 
I just don't display the id in the QTableView

Thanks