*Making the answer from comment...
The problem is that you install the event filter on the QGraphicsView
, however mouse events are handled by rather viewport than the view itself. Therefore, to make your event filter "catch" the mouse events you need to install it on the viewport:
graphicsView->viewport()->installEventFilter(filter);