You need to call base class (QGraphicsView
) implementation from your implementation. Otherwise mouse events will not be processed by QGraphicsView
and will not be passed to the scene and its items.
void MyView::mousePressEvent(QMouseEvent* e) {
QGraphicsView::mousePressEvent(e);
//your implementation
}