1385 @param evt reference to the gesture event (QGestureEvent |
1385 @param evt reference to the gesture event (QGestureEvent |
1386 """ |
1386 """ |
1387 pinch = evt.gesture(Qt.PinchGesture) |
1387 pinch = evt.gesture(Qt.PinchGesture) |
1388 if pinch: |
1388 if pinch: |
1389 if pinch.state() == Qt.GestureStarted: |
1389 if pinch.state() == Qt.GestureStarted: |
1390 pinch.setScaleFactor(self.__editor.zoomFactor() / 100.0) |
1390 pinch.setTotalScaleFactor(self.__editor.zoomFactor() / 100.0) |
1391 else: |
1391 elif pinch.state() == Qt.GestureUpdated: |
1392 self.__editor.setZoomFactor(int(pinch.scaleFactor() * 100)) |
1392 self.__editor.setZoomFactor(int(pinch.totalScaleFactor() * 100)) |
1393 self.__updateZoom() |
1393 self.__updateZoom() |
1394 evt.accept() |
1394 evt.accept() |