Have a look at QGraphicsView::drawForeground(). I use a class derived from QGraphicsView where I actually have two scenes. One of them is the conventional scene that is drawn in the paint event, the other is a special scene that holds the overlay objects. This one is drawn in drawForeground() and can have a transformation matrix different from the other scene. (The widget is actually more complex than that - it also uses the drawBackground() method to draw a bitmap image which is then overlaid by the scene, which is then overlaid by the foreground scene).Draw items over the image at a fixed place (so that they are always visible and not affected by zoom or translation).
Bookmarks