# HG changeset patch # User Markus Mützel # Date 1696772255 -7200 # Node ID 830f0a2508d584087706de3d0c13f95aaf8652cc # Parent 90abc5bf1f43ab56e67977f2c36a92012fe4b08b 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 (). diff -r 90abc5bf1f43 -r 830f0a2508d5 libgui/graphics/BaseControl.cc --- 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 { diff -r 90abc5bf1f43 -r 830f0a2508d5 libgui/graphics/ButtonGroup.cc --- 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; diff -r 90abc5bf1f43 -r 830f0a2508d5 libgui/graphics/Canvas.cc --- 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; diff -r 90abc5bf1f43 -r 830f0a2508d5 libgui/graphics/Panel.cc --- 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; diff -r 90abc5bf1f43 -r 830f0a2508d5 libgui/graphics/Table.cc --- 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 {