'Handle mouse wheel panning.'

def wheel_pan(self, event):

    unit = QtCore.QRectF(0.0, 0.0, 1.0, 1.0)
    factor = (1.0 / self.transform().mapRect(unit).width())
    (tx, ty) = qtcompat.wheel_translation(event)
    matrix = self.transform().translate((tx * factor), (ty * factor))
    self.setTransformationAnchor(QtWidgets.QGraphicsView.NoAnchor)
    self.setTransform(matrix)
