634 @param evt reference to the gesture event (QGestureEvent |
634 @param evt reference to the gesture event (QGestureEvent |
635 """ |
635 """ |
636 pinch = evt.gesture(Qt.PinchGesture) |
636 pinch = evt.gesture(Qt.PinchGesture) |
637 if pinch: |
637 if pinch: |
638 if pinch.state() == Qt.GestureStarted: |
638 if pinch.state() == Qt.GestureStarted: |
639 pinch.setScaleFactor(self.zoom() / 100.0) |
639 pinch.setTotalScaleFactor(self.zoom() / 100.0) |
640 else: |
640 elif pinch.state() == Qt.GestureUpdated: |
641 self.setZoom(int(pinch.scaleFactor() * 100)) |
641 self.setZoom(int(pinch.totalScaleFactor() * 100)) |
642 evt.accept() |
642 evt.accept() |
643 |
643 |
644 def getItemId(self): |
644 def getItemId(self): |
645 """ |
645 """ |
646 Public method to get the ID to be assigned to an item. |
646 Public method to get the ID to be assigned to an item. |