1963 @param evt reference to the gesture event (QGestureEvent |
1963 @param evt reference to the gesture event (QGestureEvent |
1964 """ |
1964 """ |
1965 pinch = evt.gesture(Qt.PinchGesture) |
1965 pinch = evt.gesture(Qt.PinchGesture) |
1966 if pinch: |
1966 if pinch: |
1967 if pinch.state() == Qt.GestureStarted: |
1967 if pinch.state() == Qt.GestureStarted: |
1968 pinch.setScaleFactor(self.__currentZoom / 100.0) |
1968 pinch.setTotalScaleFactor(self.__currentZoom / 100.0) |
1969 else: |
1969 elif pinch.state() == Qt.GestureUpdated: |
1970 scaleFactor = pinch.scaleFactor() |
1970 scaleFactor = pinch.totalScaleFactor() |
1971 self.__currentZoom = int(scaleFactor * 100) |
1971 self.__currentZoom = int(scaleFactor * 100) |
1972 self.__applyZoom() |
1972 self.__applyZoom() |
1973 evt.accept() |
1973 evt.accept() |
1974 |
1974 |
1975 def clearHistory(self): |
1975 def clearHistory(self): |