Skip to content

Commit

Permalink
Merge pull request #433 from jdrese/master
Browse files Browse the repository at this point in the history
Fix AttributeError for API change on QWheelEvent from Qt5
  • Loading branch information
jchanvfx authored Oct 3, 2024
2 parents 93aba99 + 4b5d97f commit 8f97f82
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion NodeGraphQt/widgets/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,11 @@ def wheelEvent(self, event):
delta = event.angleDelta().y()
if delta == 0:
delta = event.angleDelta().x()
self._set_viewer_zoom(delta, pos=event.pos())
try:
self._set_viewer_zoom(delta, pos=event.pos())
except AttributeError:
# For PyQt5 and above
self._set_viewer_zoom(delta, pos=event.position().toPoint())

def dropEvent(self, event):
pos = self.mapToScene(event.pos())
Expand Down

0 comments on commit 8f97f82

Please sign in to comment.