def mouse_drag_distance(event, button=Qt.LeftButton):
 diff = (event.buttonDownScreenPos(button) - event.screenPos())
 return diff.manhattanLength()

def mouse_drag_distance ( event , button = Qt . LeftButton ) : diff = ( event . buttonDownScreenPos ( button ) - event . screenPos ( ) ) return diff . manhattanLength ( )
return the distance between the mouse position when the button was pressed and the current mouse position .