diff options
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 7999eeb109..eecf590c86 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2480,6 +2480,8 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event, const bool graphicsWidget = nativeWidget->testAttribute(Qt::WA_DontShowOnScreen); + bool widgetUnderMouse = QRectF(receiver->rect()).contains(event->localPos()); + if (*buttonDown) { if (!graphicsWidget) { // Register the widget that shall receive a leave event @@ -2489,7 +2491,7 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event, if (event->type() == QEvent::MouseButtonRelease && !event->buttons()) *buttonDown = 0; } - } else if (lastMouseReceiver) { + } else if (lastMouseReceiver && widgetUnderMouse) { // Dispatch enter/leave if we move: // 1) from an alien widget to another alien widget or // from a native widget to an alien widget (first OR case) |