def _mouseMoveEvent(e): if e.buttons() == Qt.MidButton: offset = self.previousMousePos - e.pos() self.previousMousePos = e.pos() self.view.verticalScrollBar().setValue(self.view.verticalScrollBar().value() + offset.y()) self.view.horizontalScrollBar().setValue(self.view.horizontalScrollBar().value() + offset.x()) else: QGraphicsView.mouseMoveEvent(self.view, e)
def _mouseMoveEvent(e): if e.buttons() == Qt.MidButton: offset = self.previousMousePos - e.pos() self.previousMousePos = e.pos() self.view.verticalScrollBar().setValue( self.view.verticalScrollBar().value() + offset.y()) self.view.horizontalScrollBar().setValue( self.view.horizontalScrollBar().value() + offset.x()) else: QGraphicsView.mouseMoveEvent(self.view, e)
def mouseMoveEvent(self, event): if not self.__allow_mouse_translation: return QGraphicsView.mouseMoveEvent(self, event) if self.__translation_orig is not None: delta = self.__translation_orig - event.pos() delta_x = delta.x() / self.scene().sceneRect().width() * (self.parentWidget()._max_x - self.parentWidget()._min_x) self.parentWidget()._min_x = self.__translation_min_x + delta_x self.parentWidget()._max_x = self.__translation_max_x + delta_x self.parentWidget()._update_row_depths() return QGraphicsView.mouseMoveEvent(self, event)
def mouseMoveEvent(self, event): pos = self.mapToScene(event.pos()) if not self.__allow_mouse_translation: return QGraphicsView.mouseMoveEvent(self, event) if self.__translation_orig is not None: delta = self.__translation_orig - pos delta_y = delta.y() / self.scene().sceneRect().height() * (self.parentWidget()._max_z - self.parentWidget()._min_z) min_z = self.__translation_min_z + delta_y self.parentWidget()._min_z = min_z self.parentWidget()._max_z = self.__translation_max_z + delta_y self.parentWidget()._update_column_depths() return QGraphicsView.mouseMoveEvent(self, event)