Browse Source

Fix canvas usage with qt 4.6

tags/1.9.7b
falkTX 8 years ago
parent
commit
e2a0cbce42
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      source/widgets/draggablegraphicsview.py

+ 6
- 1
source/widgets/draggablegraphicsview.py View File

@@ -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())


Loading…
Cancel
Save