Fixes #1085 Signed-off-by: falkTX <falktx@falktx.com>tags/v2.2.0-RC1
@@ -612,6 +612,10 @@ class CanvasBox(QGraphicsObject): | |||||
QGraphicsObject.mouseDoubleClickEvent(self, event) | QGraphicsObject.mouseDoubleClickEvent(self, event) | ||||
def mousePressEvent(self, event): | def mousePressEvent(self, event): | ||||
if event.button() == Qt.MiddleButton or event.source() == Qt.MouseEventSynthesizedByApplication: | |||||
event.ignore() | |||||
return | |||||
canvas.last_z_value += 1 | canvas.last_z_value += 1 | ||||
self.setZValue(canvas.last_z_value) | self.setZValue(canvas.last_z_value) | ||||
self.resetLinesZValue() | self.resetLinesZValue() | ||||
@@ -147,6 +147,10 @@ class CanvasPort(QGraphicsItem): | |||||
QGraphicsItem.hoverLeaveEvent(self, event) | QGraphicsItem.hoverLeaveEvent(self, event) | ||||
def mousePressEvent(self, event): | def mousePressEvent(self, event): | ||||
if event.button() == Qt.MiddleButton or event.source() == Qt.MouseEventSynthesizedByApplication: | |||||
event.ignore() | |||||
return | |||||
if self.m_mouse_down: | if self.m_mouse_down: | ||||
self.handleMouseRelease() | self.handleMouseRelease() | ||||
self.m_hover_item = None | self.m_hover_item = None | ||||
@@ -119,7 +119,8 @@ class DraggableGraphicsView(QGraphicsView): | |||||
if event.button() == self.fMiddleButton and not self.fCtrlDown: | if event.button() == self.fMiddleButton and not self.fCtrlDown: | ||||
self.fPanning = True | self.fPanning = True | ||||
self.setDragMode(QGraphicsView.ScrollHandDrag) | self.setDragMode(QGraphicsView.ScrollHandDrag) | ||||
event = QMouseEvent(event.type(), event.pos(), Qt.LeftButton, Qt.LeftButton, event.modifiers()) | |||||
event = QMouseEvent(event.type(), event.localPos(), event.windowPos(), event.screenPos(), | |||||
Qt.LeftButton, Qt.LeftButton, event.modifiers(), Qt.MouseEventSynthesizedByApplication) | |||||
QGraphicsView.mousePressEvent(self, event) | QGraphicsView.mousePressEvent(self, event) | ||||