I just found this question, I know that it is old, but I hope that my answer will be useful for someone with this problem.
In the QGraphicsView or QGraphicsScene derived class, override the mouseMoveEvent method and check the buttons event property to see which buttons are currently pressed. Here is a sample code in PyQt4 from a small project I'm working on:
def mouseMoveEvent(self, event): buttons = event.buttons() pos = self.mapToScene(event.pos()) object = self.scene().itemAt(pos) type = EventTypes.MouseLeftMove if (buttons & Qt.LeftButton) else\ EventTypes.MouseRightMove if (buttons & Qt.RightButton) else\ EventTypes.MouseMidMove if (buttons & Qt.MidButton) else\ EventTypes.MouseMove handled = self.activeTool().handleEvent(type, object, pos) if (not handled): QGraphicsView.mouseMoveEvent(self, event)
source share