I didn't try it, but I would guess that the problem is that your second item is not part of the scene (see how you allocated it in comparison to the first one, which is IN the scene).
The second item is just an allocated item, belongs to no scene, and the filter filters *scene* events.
QGraphicsItem *firstItem = scene->addRect(QRectF(10.0, 10.0, 80.0, 80.0)); //added to scen
QGraphicsItem *secondItem = new QGraphicsRectItem(QRectF(20.0, 20.0, 60.0, 60.0)); //not in scene
To copy to clipboard, switch view to plain text mode
Bookmarks