I am using activated() to open a file in one of my columns, but that only works with the enter key. The only way I could find to allow using a mouse was to subclass QTableView and use mousePressedEvent(). This seems to be working, but it also seems too simple, and I am unsure if I did it right, or if I should not have done something more. All I did was:
Qt Code:
  1. void TableView::mousePressEvent(QMouseEvent *event)
  2. {
  3. QPoint pos = event->pos();
  4. QPersistentModelIndex index = indexAt(pos);
  5.  
  6. if(event->button() == Qt::RightButton)
  7. emit activated(index);
  8. else
  9. QAbstractItemView::mousePressEvent(event);
  10. }
To copy to clipboard, switch view to plain text mode 
Is that the proper way to do it?