Hi, im new with Qt and id like to learn a few simple things about event handling in QGraphicsView.

For now, id like to draw rects and be able to pop a messagebox with some info about clicked rect (position, size).

To achieve this, i put a QGraphicsView widget in my window and wrote a function that generate a random QRect and call myScene->addRect(myRect) to populate my scene.

Finally I use myScene->show();

Until here, is everything fine.

The problem is to write mouse event function. Ive googled a lot and read Graphics View Framework documentation too and i still dont understand how events get propagated from QGraphicsView, to QGraphicsScene, and then to QGraphicsItem

As I seen on "Diagram Scene" example, Ive create a class that "extends" QGraphicsScene and I reimplemented "void mousePressEvent(...)", but it didnt worked.

My question is: Which classes I must inherit, to override mouse events, and where should i handle them.

Thanks in advance