I think you should implement the legend / palette overlay from the QGraphics context, if you move (setPosition ...) this element to invert the custom transform, the element will be re-indexed in the graphics tree anytime you pan / zoom .. .
, , , , , QGraphicsView (wicth - ) paintEvent, / ( ). , / , pixmap pixmap , QGraphicsView (, ...).
, .