changeset 32388:830f0a2508d5

gui: Replace QMouseEvent::globalPos() by QMouseEvent::globalPosition() for Qt6. * libgui/graphics/BaseControl.cc (BaseControl::eventFilter), libgui/graphics/ButtonGroup.cc (ButtonGroup::eventFilter), libgui/graphics/Canvas.cc (Canvas::canvasMousePressEvent), libgui/graphics/Panel.cc (Panel::eventFilter), libgui/graphics/Table.cc (Table::eventFilter): For Qt6, replace usage of deprecated QMouseEvent::globalPos () by QMouseEvent::globalPosition ().toPoint ().
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 08 Oct 2023 15:37:35 +0200
parents 90abc5bf1f43
children e30bddd8ebaf
files libgui/graphics/BaseControl.cc libgui/graphics/ButtonGroup.cc libgui/graphics/Canvas.cc libgui/graphics/Panel.cc libgui/graphics/Table.cc
diffstat 5 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/BaseControl.cc	Sun Oct 08 14:57:20 2023 +0200
+++ b/libgui/graphics/BaseControl.cc	Sun Oct 08 15:37:35 2023 +0200
@@ -273,7 +273,12 @@
                 emit gh_callback_event (m_handle, "buttondownfcn");
 
                 if (m->button () == Qt::RightButton)
-                  ContextMenu::executeAt (m_interpreter, up, m->globalPos ());
+                  ContextMenu::executeAt (m_interpreter, up,
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+                                          m->globalPosition ().toPoint ());
+#else
+                                          m->globalPos ());
+#endif
               }
             else
               {
--- a/libgui/graphics/ButtonGroup.cc	Sun Oct 08 14:57:20 2023 +0200
+++ b/libgui/graphics/ButtonGroup.cc	Sun Oct 08 15:37:35 2023 +0200
@@ -233,7 +233,11 @@
                     octave::autolock guard (gh_mgr.graphics_lock ());
 
                     ContextMenu::executeAt (m_interpreter, properties (),
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+                                            m->globalPosition ().toPoint ());
+#else
                                             m->globalPos ());
+#endif
                   }
               }
               break;
--- a/libgui/graphics/Canvas.cc	Sun Oct 08 14:57:20 2023 +0200
+++ b/libgui/graphics/Canvas.cc	Sun Oct 08 15:37:35 2023 +0200
@@ -683,7 +683,11 @@
             if (currentObj && event->button () == Qt::RightButton)
               ContextMenu::executeAt (m_interpreter,
                                       currentObj.get_properties (),
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+                                      event->globalPosition ().toPoint ());
+#else
                                       event->globalPos ());
+#endif
           }
           break;
 
--- a/libgui/graphics/Panel.cc	Sun Oct 08 14:57:20 2023 +0200
+++ b/libgui/graphics/Panel.cc	Sun Oct 08 15:37:35 2023 +0200
@@ -220,7 +220,11 @@
                     if (go.valid_object ())
                       ContextMenu::executeAt (m_interpreter,
                                               go.get_properties (),
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+                                              m->globalPosition ().toPoint ());
+#else
                                               m->globalPos ());
+#endif
                   }
               }
               break;
--- a/libgui/graphics/Table.cc	Sun Oct 08 14:57:20 2023 +0200
+++ b/libgui/graphics/Table.cc	Sun Oct 08 15:37:35 2023 +0200
@@ -1547,7 +1547,11 @@
 
                 if (m->button () == Qt::RightButton)
                   ContextMenu::executeAt (m_interpreter, properties (),
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+                                          m->globalPosition ().toPoint ());
+#else
                                           m->globalPos ());
+#endif
               }
             else
               {
@@ -1689,7 +1693,12 @@
                 emit gh_callback_event (m_handle, "buttondownfcn");
 
                 if (m->button () == Qt::RightButton)
-                  ContextMenu::executeAt (m_interpreter, tp, m->globalPos ());
+                  ContextMenu::executeAt (m_interpreter, tp,
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+                                          m->globalPosition ().toPoint ());
+#else
+                                          m->globalPos ());
+#endif
               }
             else
               {