Move panning to middle button

This commit is contained in:
Mika Fischer
2011-06-30 17:37:32 +02:00
parent 56ad08aca7
commit 1582e1f923
+2 -2
View File
@@ -90,7 +90,7 @@ class GraphicsView(QGraphicsView):
QGraphicsView.resizeEvent(self, event)
def mousePressEvent(self, event):
if event.button() & Qt.RightButton != 0:
if event.button() & Qt.MiddleButton != 0:
self._pan = True
self._panStartX = event.x()
self._panStartY = event.y()
@@ -100,7 +100,7 @@ class GraphicsView(QGraphicsView):
return QGraphicsView.mousePressEvent(self, event)
def mouseReleaseEvent(self, event):
if event.button() & Qt.RightButton != 0:
if self._pan:
self._pan = False
self.setCursor(Qt.ArrowCursor)
event.accept()