[LyX/master] Fix Qt6 deprecation warning (QEvent::globalPos())
Juergen Spitzmueller
spitz at lyx.org
Sun Mar 21 11:33:12 UTC 2021
commit cbc55548a34ec562950809f2ac4067d7bf1c8294
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Sun Mar 21 12:37:17 2021 +0100
Fix Qt6 deprecation warning (QEvent::globalPos())
---
src/frontends/qt/InsertTableWidget.cpp | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/frontends/qt/InsertTableWidget.cpp b/src/frontends/qt/InsertTableWidget.cpp
index 773151f..70f53e2 100644
--- a/src/frontends/qt/InsertTableWidget.cpp
+++ b/src/frontends/qt/InsertTableWidget.cpp
@@ -76,7 +76,11 @@ void InsertTableWidget::mouseMoveEvent(QMouseEvent * event)
{
// do this ourselves because when the mouse leaves the app
// we get an enter event (ie underMouse() is true)!!
+#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
+ underMouse_ = geometry().contains(event->globalPosition().toPoint());
+#else
underMouse_ = geometry().contains(event->globalPos());
+#endif
if (!underMouse_) {
bottom_ = 0;
right_ = 0;
@@ -102,7 +106,11 @@ void InsertTableWidget::mouseMoveEvent(QMouseEvent * event)
if (bottom_ != b0 || right_ != r0) {
update();
QString const status = QString("%1x%2").arg(bottom_).arg(right_);
+#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
+ QToolTip::showText(event->globalPosition().toPoint(), status , this);
+#else
QToolTip::showText(event->globalPos(), status , this);
+#endif
}
}
More information about the lyx-cvs
mailing list