idx = index.model()->index(0, index.row());//0 -- id field
int id = index.data(Qt::EditRole).toInt();
...
...
if (!index.isValid())
return;
QModelIndex idx;
if (!index.column())
idx = index;
else
idx = index.model()->index(0, index.row());//0 -- id field
int id = index.data(Qt::EditRole).toInt();
...
To copy to clipboard, switch view to plain text mode
and it worked fine.
you are wellcome. but I suggest you to use code from my last post, it is more clear to use (for this task), but in general case this one more preferred.
Bookmarks