220 @param evt reference to the gesture event (QGestureEvent |
220 @param evt reference to the gesture event (QGestureEvent |
221 """ |
221 """ |
222 pinch = evt.gesture(Qt.PinchGesture) |
222 pinch = evt.gesture(Qt.PinchGesture) |
223 if pinch: |
223 if pinch: |
224 if pinch.state() == Qt.GestureStarted: |
224 if pinch.state() == Qt.GestureStarted: |
225 pinch.setScaleFactor(self.__zoom() / 100) |
225 pinch.setTotalScaleFactor(self.__zoom() / 100) |
226 else: |
226 elif pinch.state() == Qt.GestureUpdated: |
227 self.__doZoom(int(pinch.scaleFactor() * 100)) |
227 self.__doZoom(int(pinch.totalScaleFactor() * 100)) |
228 evt.accept() |
228 evt.accept() |
229 |
229 |
230 ########################################################################### |
230 ########################################################################### |
231 ## Private menu handling methods below. |
231 ## Private menu handling methods below. |
232 ########################################################################### |
232 ########################################################################### |