Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self.GraphicsView.installEventFilter(self)
- self.GraphicsView.mousePressEvent = self.qView_mousePressEvent
- def eventFilter(self,obj,event):
- if obj is self.GraphicsView:
- if event.button() != QtCore.Qt.LeftButton:
- self.qView_mousePressEvent(event)
- return True
- return super(RigModuleUi, self).eventFilter(obj, event)
- def qView_mousePressEvent(self,event):
- if (app.keyboardModifiers() == QtCore.Qt.AltModifier and event.button() == QtCore.Qt.MiddleButton):
- self.GraphicsView.setCursor(QtCore.Qt.SizeAllCursor)
- if (app.keyboardModifiers() == QtCore.Qt.AltModifier and event.button() == QtCore.Qt.RightButton):
- self.GraphicsView.setCursor(QtCore.Qt.SizeVerCursor)
- if event.button() == QtCore.Qt.LeftButton:
- QtGui.QGraphicsView.mousePressEvent(self.GraphicsView, event)
Advertisement
Add Comment
Please, Sign In to add comment