I have a UI and a QGraphicsScene subclass GraphicsScene that implements mousePressEvent(), however mouse clicks are being ignored.
ui->setupUi(this);
scene = new GraphicsScene(this);
scene->addPixmap(QPixmap::fromImage(someImage));
ui->graphicsView->setScene(scene);
connect(scene, SIGNAL(clicked(QPoint)), this, SLOT(someSlot(QPoint)));
GraphicsScene::mousePressEvent() is not called, and so does not emit signal clicked(). Is there something else I need to set to enable this?
UPDATE:
void GraphicsView::mousePressEvent(QMouseEvent *event) {
emit clicked(event->pos());
}
It's connected to a slot of the right signature.