diff --git a/rqt_bag/src/rqt_bag/timeline_frame.py b/rqt_bag/src/rqt_bag/timeline_frame.py index 60ce2c7e..9d38b2e2 100644 --- a/rqt_bag/src/rqt_bag/timeline_frame.py +++ b/rqt_bag/src/rqt_bag/timeline_frame.py @@ -1087,7 +1087,11 @@ def on_mouse_up(self, event): self.scene().update() def on_mousewheel(self, event): - dz = event.delta() / 120.0 + try: + delta = event.angleDelta().y() + except AttributeError: + delta = event.delta() + dz = delta / 120.0 self.zoom_timeline(1.0 - dz * 0.2) def on_mouse_move(self, event): diff --git a/rqt_graph/src/rqt_graph/interactive_graphics_view.py b/rqt_graph/src/rqt_graph/interactive_graphics_view.py index 40a15a05..60f97c90 100644 --- a/rqt_graph/src/rqt_graph/interactive_graphics_view.py +++ b/rqt_graph/src/rqt_graph/interactive_graphics_view.py @@ -64,7 +64,10 @@ def mouseMoveEvent(self, mouse_event): def wheelEvent(self, wheel_event): if wheel_event.modifiers() == Qt.NoModifier: - delta = wheel_event.delta() + try: + delta = wheel_event.angleDelta().y() + except AttributeError: + delta = wheel_event.delta() delta = max(min(delta, 480), -480) mouse_before_scale_in_scene = self.mapToScene(wheel_event.pos()) diff --git a/rqt_plot/src/rqt_plot/data_plot/qwt_data_plot.py b/rqt_plot/src/rqt_plot/data_plot/qwt_data_plot.py index bdaccd92..54936a30 100644 --- a/rqt_plot/src/rqt_plot/data_plot/qwt_data_plot.py +++ b/rqt_plot/src/rqt_plot/data_plot/qwt_data_plot.py @@ -214,7 +214,11 @@ def wheelEvent(self, event): # mouse wheel zooms the y-axis # y position of pointer in graph coordinates canvas_y = event.y() - self.canvas().y() - zoom_factor = max(-0.6, min(0.6, (event.delta() / 120) / 6.0)) + try: + delta = event.angleDelta().y() + except AttributeError: + delta = event.delta() + zoom_factor = max(-0.6, min(0.6, (delta / 120) / 6.0)) delta_y = (self.canvas().height() / 2.0) - canvas_y self.move_canvas(0, zoom_factor * delta_y * 1.0225)