summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2014-03-18 16:27:40 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-20 11:24:29 +0100
commit41dd38a0e2b76b320205aa4656e855c724bc28d1 (patch)
tree076355aa15f19317550b70297bf02cb3674b0fc7
parentb6e15e047d7f981cbd987e60a1adcf62a57010a1 (diff)
QMenu: Sloppy menu selection should allow hovering separators
Setting the current action to 0 clears the sloppy region and closes the submenu if we hover a separator on the way to the submenu popup. Now, we choose not to while the sloppy delay timer is running. This is a backport of I9d1b1358fe64c259dc47f35db8fc8f2b19a73153 from qt/qtbase. Task-number: QTBUG-20094 Change-Id: If4b3cff05a9bcb41cee3e49490d4cc5fc3595821 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r--src/gui/widgets/qmenu.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 0e4ecde237..75ee80a4bd 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -2864,6 +2864,7 @@ void QMenu::mouseMoveEvent(QMouseEvent *e)
QAction *action = d->actionAt(e->pos());
if (!action || action->isSeparator()) {
if (d->hasHadMouse
+ && d->sloppyDelayTimer == 0 // Keep things as they are while we're moving to the submenu
&& (!d->currentAction || (action && action->isSeparator())
|| !(d->currentAction->menu() && d->currentAction->menu()->isVisible())))
d->setCurrentAction(0);