def mouseMoveEvent(self, event): """Handles mouse movement""" if self.lmbOrigin and self.rubberBand: # Draw the rubber band selection rectangle rect = QRect(self.lmbOrigin, event.scenePos().toPoint()) self.rubberBand.setGeometry(rect.normalized()) if not self.__isRubberBandVisible(): if abs(rect.left() - rect.right()) >= RUBBER_BAND_MIN_SIZE or \ abs(rect.top() - rect.bottom()) >= RUBBER_BAND_MIN_SIZE: self.rubberBand.show() QGraphicsScene.mouseMoveEvent(self, event)
def mouseMoveEvent(self, event): if self.origin is not None: if self.rubberBand: rect = QRect(self.origin, event.scenePos().toPoint()) self.rubberBand.setGeometry(rect.normalized()) QGraphicsScene.mouseMoveEvent(self, event)