I am working on an application which has 2 representations of a diagram.

1. Drawing view. Elements are drawn as parent, children and siblings. For this I am using QGraphicsView / QGraphicsScene /QGraphicItem etc.
2. Tree view. The diagram also needs to to represented as a tree.

When the diagram is edited the tree view should be updated and vice-versa.

I was thinking if its possible to use QAbstractItemModel to represent the both. Basically the model will have QGraphicsItem(s) as the data and then both the views (tree and scene) gets updated when the model changes.

If the above solution not possible then can you please suggest best possible solution in this case?

Thanks a lot