I wish to allow users to select a set of geographical areas from a list/tree or by clicking on a map overlaid with tiles representing the areas. The idea is that the list/tree and map should share the same base model and selection model and stay nicely synchronised.

I read here and the sage advise of Wysota to use a bare QGraphicsScene to render into the viewport of the QAbstractItemView. The gist of this is working although it is far from pretty at this point.

I am looking for advice on how to store connection between a model index and its matching QGraphicsItem. Model indexes themselves are quite fragile and, while I could use the index's internal pointer as an opaque key, I wonder if there is not some 'proper' method that I am missing.