'Return *rect* mapped from device coordinates (pixels) to local coordinates.
If there is no device mapping available, return None.'

def mapRectFromDevice(self, rect):

    vt = self.deviceTransform()
    if (vt is None):
        return None
    vt = fn.invertQTransform(vt)
    return vt.mapRect(rect)
