diff libgui/graphics/Canvas.cc @ 29048:440ace36950e stable

avoid warnings about deprecated QWheelEvent::pos method * TerminalView.cpp (TerminalView::wheelEvent): Use QWheelEvent::position if available. * Canvas.cc (Canvas::canvasWheelEvent): Likewise. * acinclude.m4 (OCTAVE_CHECK_FUNC_QWHEELEVENT_POSITION): New macro. (OCTAVE_CHECK_QT_VERSION): Use it.
author John W. Eaton <jwe@octave.org>
date Wed, 11 Nov 2020 23:18:47 -0500
parents 94396ec1a89d
children 226df400639c 0a5b15007766
line wrap: on
line diff
--- a/libgui/graphics/Canvas.cc	Wed Nov 11 23:08:08 2020 -0500
+++ b/libgui/graphics/Canvas.cc	Wed Nov 11 23:18:47 2020 -0500
@@ -928,7 +928,12 @@
 
             if (childObj.isa ("axes"))
               {
-                graphics_object go = selectFromAxes (childObj, event->pos ());
+#if defined (HAVE_QWHEELEVENT_POSITION)
+                QPoint pos = event->position().toPoint ();
+#else
+                QPoint pos = event->pos ();
+#endif
+                graphics_object go = selectFromAxes (childObj, pos);
 
                 if (go)
                   {