I'd like to know when items are added to or removed from a QGraphicsScene from within the scene. Is there an easy way to do that, or do I have to do it in the constructor and destructor of the QGraphicsItems?

In particular, I'd like to emit a signal whenever an item is added or removed so that I can use setWindowModified(true) in my QMainWindow.