
Originally Posted by
spirit
QString email
= index.
data(Qt
::EditRole).
toString();
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
QSqlQuery query
("SELECT email.id,addresses.name,email.subject,email.date FROM email,addresses WHERE addresses.id=email.'from'");
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
Bookmarks