diff options
author | Debao Zhang <dbzhang800@gmail.com> | 2012-05-31 21:26:53 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-01 18:26:18 +0200 |
commit | a86efb543dc9f99fe8bb45a46f2bc6959b70770c (patch) | |
tree | ca5e85624fb0fe15a4f461e7f8096610cc4464e9 /src | |
parent | 4f27960dd85f88c84998be02817e0674c43adbdf (diff) |
Fix QApplicationPrivate::pickMouseReceiver() crash
When a widget associate with a QWidgetWindow received a mouse event, but
another widget which is not a child of the widget has grabbed the mouse, the
application will crash. As QWidget::mapFrom() only works when mapping from
parent to child.
This is the side effect of SHA: f6c107d799d14bbdb2cb71b8446483541bb0adb5
Task-number: QTBUG-25985
Change-Id: If2e6289e02d6d67c215694f2217221c9c7a0af46
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index f4a565c4d0..1ca30c5819 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2447,7 +2447,7 @@ QWidget *QApplicationPrivate::pickMouseReceiver(QWidget *candidate, const QPoint if (mouseGrabber && mouseGrabber != candidate) { receiver = mouseGrabber; - *pos = receiver->mapFrom(candidate, windowPos); + *pos = receiver->mapFromGlobal(candidate->mapToGlobal(windowPos)); #ifdef ALIEN_DEBUG qDebug() << " ** receiver adjusted to:" << receiver << "pos:" << pos; #endif |