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

def mapFromDevice(self, obj):

    vt = self.deviceTransform()
    if (vt is None):
        return None
    if isinstance(obj, QtCore.QPoint):
        obj = QtCore.QPointF(obj)
    vt = fn.invertQTransform(vt)
    return vt.map(obj)
