use eventFilter() and filter the mouse events ...

Qt Code:
  1. bool myGraphicsView:: eventFilter(QObject *ob, QEvent *e)
  2. {
  3. if(ob == item_need_filter && e->type() == QEvent::MousePress /**any event u want to filter**/) {
  4. .......
  5. }
  6. return true;
  7. }
  8. return QWidget::eventFilter(ob, e);
  9. }
To copy to clipboard, switch view to plain text mode