That's because you didn't install the filter on the correct object.

It should be:
Qt Code:
  1. view->viewport()->installEventFilter(this);
To copy to clipboard, switch view to plain text mode