An update will be applied December 9th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 8f0c2934 authored by David Gobbi's avatar David Gobbi Committed by Kitware Robot
Browse files

Merge topic 'release-fix-interactor-pyqt5-compatibility' into release

6b1d302f

 Fix mouse wheel zooming in PyQt interactor
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1186
parents 3ecb4cd9 6b1d302f
Pipeline #6482 failed with stage
......@@ -186,6 +186,7 @@ class QVTKRenderWindowInteractor(QWidget):
self.__saveY = 0
self.__saveModifiers = Qt.NoModifier
self.__saveButtons = Qt.NoButton
self.__wheelDelta = 0
# do special handling of some keywords:
# stereo, rw
......@@ -426,10 +427,17 @@ class QVTKRenderWindowInteractor(QWidget):
self._Iren.KeyReleaseEvent()
def wheelEvent(self, ev):
if ev.delta() >= 0:
self._Iren.MouseWheelForwardEvent()
if hasattr(ev, 'delta'):
self.__wheelDelta += ev.delta()
else:
self.__wheelDelta += ev.angleDelta().y()
if self.__wheelDelta >= 120:
self._Iren.MouseWheelForwardEvent()
self.__wheelDelta = 0
elif self.__wheelDelta <= -120:
self._Iren.MouseWheelBackwardEvent()
self.__wheelDelta = 0
def GetRenderWindow(self):
return self._RenderWindow
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment