From e2a0cbce421e07be4168d7e3916d09cdf008ca62 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 7 Jan 2017 18:54:28 +0000 Subject: [PATCH] Fix canvas usage with qt 4.6 --- source/widgets/draggablegraphicsview.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/widgets/draggablegraphicsview.py b/source/widgets/draggablegraphicsview.py index cbf32b9ba..a59e4a7f5 100644 --- a/source/widgets/draggablegraphicsview.py +++ b/source/widgets/draggablegraphicsview.py @@ -41,8 +41,13 @@ class DraggableGraphicsView(QGraphicsView): self.fPanning = False + try: + self.fMiddleButton = Qt.MiddleButton + except: + self.fMiddleButton = Qt.MidButton + def mousePressEvent(self, event): - if event.button() == Qt.MiddleButton: + if event.button() == self.fMiddleButton: self.fPanning = True self.setDragMode(QGraphicsView.ScrollHandDrag) event = QMouseEvent(event.type(), event.pos(), Qt.LeftButton, Qt.LeftButton, event.modifiers())