diff --git a/source/frontend/patchcanvas/canvasport.py b/source/frontend/patchcanvas/canvasport.py index 662fd80d9..d308c92fa 100644 --- a/source/frontend/patchcanvas/canvasport.py +++ b/source/frontend/patchcanvas/canvasport.py @@ -147,6 +147,8 @@ class CanvasPort(QGraphicsItem): QGraphicsItem.hoverLeaveEvent(self, event) def mousePressEvent(self, event): + if self.m_mouse_down: + self.handleMouseRelease() self.m_hover_item = None self.m_mouse_down = bool(event.button() == Qt.LeftButton) self.m_cursor_moving = False @@ -209,7 +211,7 @@ class CanvasPort(QGraphicsItem): self.m_line_mov.updateLinePos(event.scenePos()) - def mouseReleaseEvent(self, event): + def handleMouseRelease(self): if self.m_mouse_down: if self.m_line_mov is not None: item = self.m_line_mov @@ -265,6 +267,9 @@ class CanvasPort(QGraphicsItem): self.m_hover_item = None self.m_mouse_down = False self.m_cursor_moving = False + + def mouseReleaseEvent(self, event): + self.handleMouseRelease() QGraphicsItem.mouseReleaseEvent(self, event) def contextMenuEvent(self, event): diff --git a/source/frontend/patchcanvas/scene.py b/source/frontend/patchcanvas/scene.py index 84ba27971..365a0321f 100644 --- a/source/frontend/patchcanvas/scene.py +++ b/source/frontend/patchcanvas/scene.py @@ -374,14 +374,11 @@ class PatchScene(QGraphicsScene): self.m_mouse_rubberband = False if event.button() == Qt.MidButton: - event.accept() - self.m_mid_button_down = False # Connection cut mode off if self.m_ctrl_down: self.m_view.viewport().unsetCursor() - return QGraphicsScene.mouseReleaseEvent(self, event)