From 37d5aaa4b42f9c837f0d27edb9da2185971d02be Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 11 Jun 2020 09:24:12 +0200 Subject: Change QWindow/QWidget::map(To/From)(Global/Parent) to operate in float Change the functions to operate in float and add the QPoint versions as overload calling them. This is more in-line with the event accessors using float and allows for removing some workarounds using a delta when converting touch points. Leave QPlatformWindow::map(To/From)Global() as is for now and add helpers for float. Change-Id: I2d46b8dbda8adff26539e358074b55073dc80b6f Reviewed-by: Shawn Rutledge Reviewed-by: Volker Hilsheimer --- src/widgets/widgets/qmenu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/widgets/widgets/qmenu.cpp') diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 5edc480949..74420ecb2c 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1356,14 +1356,14 @@ bool QMenuPrivate::mouseEventTaken(QMouseEvent *e) for(QWidget *caused = causedPopup.widget; caused;) { bool passOnEvent = false; QWidget *next_widget = nullptr; - QPoint cpos = caused->mapFromGlobal(e->globalPosition().toPoint()); + QPointF cpos = caused->mapFromGlobal(e->globalPosition()); #if QT_CONFIG(menubar) if (QMenuBar *mb = qobject_cast(caused)) { - passOnEvent = mb->rect().contains(cpos); + passOnEvent = mb->rect().contains(cpos.toPoint()); } else #endif if (QMenu *m = qobject_cast(caused)) { - passOnEvent = m->rect().contains(cpos); + passOnEvent = m->rect().contains(cpos.toPoint()); next_widget = m->d_func()->causedPopup.widget; } if (passOnEvent) { -- cgit v1.2.3