Details
-
Suggestion
-
Resolution: Incomplete
-
Not Evaluated
-
4.5.0
-
None
Description
I wanted to figure out how similar a QGraphicsScene with items is compared to a regular QApplication with widgets. Reason: A lot effort is going on on qt-labs that uses QGraphicsView for all kinds of fancy stuff.
Currently you can filter all events that go through a QApplication using QApplication::installEvent filter. You only need one event filter object to filter all events.
Similar, you can install event filters to QGraphicsItems.
However you cannot install an event filter to the QGraphicsScene to get the events of all children items. There is also no way to get notified when new children are added to the QGraphicsScene or to its children.
I think it is important to be feature equivalent with widgets here if stuff like QtKinetics should ever be successful because you cannot trade animations against other features.
So my suggestion is:
- Either add some kind of "installSceneEventFilter" to QGraphicsScene or pass all events regarding QGraphicsItems through the ::event-handler of the GraphicsScene if this is not already the case. If it is, document it.
- Add child added/child remove events to the GraphicsSceneEvents so both the scene and the item can get notified if something in the tree-hierarchy changes.