190 @param evt reference to the gesture event (QGestureEvent |
190 @param evt reference to the gesture event (QGestureEvent |
191 """ |
191 """ |
192 pinch = evt.gesture(Qt.PinchGesture) |
192 pinch = evt.gesture(Qt.PinchGesture) |
193 if pinch: |
193 if pinch: |
194 if pinch.state() == Qt.GestureStarted: |
194 if pinch.state() == Qt.GestureStarted: |
195 pinch.setScaleFactor(self.__zoom() / 100) |
195 pinch.setTotalScaleFactor(self.__zoom() / 100) |
196 else: |
196 elif pinch.state() == Qt.GestureUpdated: |
197 self.__doZoom(int(pinch.scaleFactor() * 100)) |
197 self.__doZoom(int(pinch.totalScaleFactor() * 100)) |
198 evt.accept() |
198 evt.accept() |
199 |
199 |
200 ########################################################################### |
200 ########################################################################### |
201 ## Private menu handling methods below. |
201 ## Private menu handling methods below. |
202 ########################################################################### |
202 ########################################################################### |