def mouseMoveEvent(self, event: QtGui.QMouseEvent) -> None: # print("mouse move detected", self._text) if event.buttons() == Qt.LeftButton and self.hasPcGrabbed: # send mouse position to pb # set pc loos end to mouse pos self.parent().moveLastPC(self.mapToParent(event.pos())) else: # set pc to hevered if the mouse in on the pp self.setPcToHoveredIfCursorOnPp(event)
def mouseMoveEvent(self, event: QtGui.QMouseEvent): if (event.buttons() & QtGui.Qt.MiddleButton and (not(event.modifiers() & QtGui.Qt.ShiftModifier))) or event.buttons() & QtCore.Qt.LeftButton: self.stopViewAnimation() self.m_yRot = self.normalizeAngle(self.m_yLastRot - (event.pos().x() - self.m_lastPos.x()) * 0.5) self.m_xRot = self.m_xLastRot + (event.pos().y() - self.m_lastPos.y()) * 0.5 if self.m_xRot < -90: self.m_xRot = -90 if self.m_xRot > 90: self.m_xRot = 90 self.updateView() self.rotationChanged.emit() if (event.buttons() & QtCore.Qt.MiddleButton and event.modifiers() & QtGui.Qt.ShiftModifier) or event.buttons() & QtCore.Qt.RightButton: self.m_xPan = self.m_xLastPan - (event.pos().x() - self.m_lastPos.x()) * 1 / (float)(self.width()) self.m_yPan = self.m_yLastPan + (event.pos().y() - self.m_lastPos.y()) * 1 / (float)(self.height()) self.updateProjection()