def METHOD_NAME(self, event):
    """
    Handles all mouse move events.
    :param event: QMouseEvent instance
    """
    self.update()
    if self._edge:
        r = self.rect()
        scenePos = event.scenePos()
        if self._edge == "top":
            diff = self.y() - scenePos.y()
            if r.height() - diff > 0:
                self.setPos(self.x(), scenePos.y())
                self.setRect(0, 0, self.rect().width(), self.rect().height() + diff)
            else:
                self._edge = "bottom"
                self.setPos(self.x(), self.y() + self.rect().height())
                self.setRect(0, 0, self.rect().width(), diff - self.rect().height())
        elif self._edge == "left":
            diff = self.x() - scenePos.x()
            if r.width() - diff > 0:
                self.setPos(scenePos.x(), self.y())
                self.setRect(0, 0, r.width() + diff, self.rect().height())
            else:
                self._edge = "right"
                self.setPos(self.x() + self.rect().width(), self.y())
                self.setRect(0, 0, diff - self.rect().width(), self.rect().height())
        elif self._edge == "bottom":
            if r.height() > 0:
                pos = self.mapFromScene(scenePos)
                self.setRect(0, 0, self.rect().width(), pos.y())
            else:
                self.setRect(0, 0, self.rect().width(), abs(scenePos.y() - self.y()))
                self.setPos(self.x(), scenePos.y())
                self._edge = "top"
        elif self._edge == "right":
            if r.width() > 0:
                pos = self.mapFromScene(scenePos)
                self.setRect(0, 0, pos.x(), self.rect().height())
            else:
                self.setRect(0, 0, abs(scenePos.x() - self.x()), self.rect().height())
                self.setPos(scenePos.x(), self.y())
                self._edge = "left"
    QtWidgets.QGraphicsItem.METHOD_NAME(self, event)