QExtendedGraphicsView extends the QGraphicsView to feature panning (right mouse button) and zooming (mouse wheel) and extends it to feature HUD elements which are not affected by these transformations.
scene
the QGraphicsScene objectorigin
a QGraphicsItem object which serves as the parent for all objects which should be affected by zoom and panhud
a QGraphicsItem object which serves as parent for all objects whcih should not be affected by zoom and pan
fitInView()
adjust the zoom and pan to show everything which is child oforigin
getOriginScale()
returns the scale of the zoomingmapSceneToOrigin(pos)
maps the pointpos
from scene coordinates to the coordinate system oforigin
mapToOrigin(pos)
maps the pointpos
from view coordinates to the coordinate system oforigin
zoomEvent(self, scale, pos)
is called when the zoom is changedpanEvent(self, x, y)
is called when the pan is changed
Import with from QExtendedGraphicsView import QExtendedGraphicsView
and create the view with QExtendedGraphicsView()