Пример #1
0
    def mousePressEvent(self, event):
        """
		
		:param event: 
		"""
        QGLWidget.mousePressEvent(self, event)
        self.__updateMouse(event, pressed=True)
        self.repaint()

        if self._mouseLeftDown:
            self._mouseStartDragPoint = self._mouseGLPosition
        if self._mouseRightDown:
            self._lastMouseGLPosition = self._mouseGLPosition

        self.onPress(event.button(), self._mousePosition,
                     self._mouseGLPosition)
Пример #2
0
    def mousePressEvent(self, event):
        QGLWidget.mousePressEvent(self, event)
        self._mouseDown = True
        self._mouseX = event.x()
        self._mouseY = event.y()
        self.repaint()

        if event.button() == 1:
            self._mouseLeftDown = True
            self._mouseStartDragPoint = (self._glX - self._x,
                                         self._height - self._glY + self._y)

        if event.button() == 2:
            self._mouseRightDown = True
            self._lastGlX = self._glX
            self._lastGlY = self._glY

        self.onPress(event.button(),
                     (self._glX - self._x, self._height - self._glY + self._y))