Quote Originally Posted by Kesy View Post
Thanks a lot man, you are a genius
I used this
Qt Code:
  1. ...
  2. if (!index.isValid())
  3. return;
  4.  
  5. if (!index.column())
  6. idx = index;
  7. else
  8. idx = index.model()->index(0, index.row());//0 -- id field
  9.  
  10. int id = index.data(Qt::EditRole).toInt();
  11. ...
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.