From 3c1713325d0594fa8db5ce056f66eebe7151d4a0 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 2 Jul 2022 18:12:15 +0300 Subject: [PATCH 44/44] Qt: Avoid deprecated QMouseEvent::localPos() in Qt6-mode See osdn #44963 Signed-off-by: Marko Lindqvist --- client/gui-qt/hudwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/gui-qt/hudwidget.cpp b/client/gui-qt/hudwidget.cpp index 8a146b5c0c..8d954b29b3 100644 --- a/client/gui-qt/hudwidget.cpp +++ b/client/gui-qt/hudwidget.cpp @@ -1964,7 +1964,11 @@ void scale_widget::paintEvent(QPaintEvent *event) void scale_widget::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { +#ifndef FC_QT5_MODE + if (event->position().x() <= size) { +#else /* FC_QT5_MODE */ if (event->localPos().x() <= size) { +#endif /* FC_QT5_MODE */ scale = scale / 1.2; } else { scale = scale * 1.2; @@ -1973,7 +1977,6 @@ void scale_widget::mousePressEvent(QMouseEvent *event) } } - /************************************************************************//** Hud battle log contructor ****************************************************************************/ -- 2.35.1