def METHOD_NAME(self, event):
    """Move the widget if it is currently being dragged.
    We use the global position in order to avoid a flickering motion. Once the mouse
    is outside the parent widget, the movement is stopped.
    """
    if self.moving:
        if USE_PYQT5:
            event_pos = event.globalPos()
        else:
            event_pos = event.globalPosition().toPoint()
        origin = self.image.mapToGlobal(QPoint(0, 0))
        if not self.image.geometry().contains(event_pos - origin):
            return
        point = event_pos - origin - self._offset
        self.move(point)
        self.update_selected_rect()
        api.status.update("crop widget moved")