summaryrefslogtreecommitdiff
path: root/src/controls/qtmenupopupwindow.cpp
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-02-25 17:04:44 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-25 17:09:16 +0100
commitf697b1260899137598d35c7b7272bc4ba2f82596 (patch)
tree1b0b0ed83c205d49b4ebcb9e9c709637568c484a /src/controls/qtmenupopupwindow.cpp
parent7cf9b32258c0c1b11cc12693f6feef7dc9d13ef7 (diff)
downloadqtquickcontrols-f697b1260899137598d35c7b7272bc4ba2f82596.tar.gz
Menu: Fix closing popup menu by clicking outside
... when we never moved the cursor inside the menu. Change-Id: I1645656ebcc047e5d231dda9daeab2484d0fd9c0 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/qtmenupopupwindow.cpp')
-rw-r--r--src/controls/qtmenupopupwindow.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/controls/qtmenupopupwindow.cpp b/src/controls/qtmenupopupwindow.cpp
index 8b3bed45..dcb15d22 100644
--- a/src/controls/qtmenupopupwindow.cpp
+++ b/src/controls/qtmenupopupwindow.cpp
@@ -111,12 +111,11 @@ void QtMenuPopupWindow::updatePosition()
void QtMenuPopupWindow::mouseMoveEvent(QMouseEvent *e)
{
QRect rect = QRect(QPoint(), size());
- if (rect.contains(e->pos())) {
- m_mouseMoved = true;
+ m_mouseMoved = true;
+ if (rect.contains(e->pos()))
QQuickWindow::mouseMoveEvent(e);
- } else {
+ else
forwardEventToTransientParent(e);
- }
}
void QtMenuPopupWindow::mouseReleaseEvent(QMouseEvent *e)