diff options
author | Michal Policht <michpolicht@gmail.com> | 2015-09-23 19:13:10 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-01-30 20:14:13 +0000 |
commit | c7c7a22bb41227ca2c379429d5750da0f0b5458d (patch) | |
tree | d3da863775f7489825b1a854384e61af30540fef | |
parent | 157445e64a277098b309b2bdfeda769f443b659d (diff) |
Fix flickering status tips in submenus.
Changed setCurrentAction() function so that it reselects parent menu
action only if mouse is over a menu and parent menu is not already
selected.
Task-number: QTBUG-47987
Change-Id: Id077d6ce1de1335ba2709180c8480af5d1720de0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Michal Policht <michpolicht@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
-rw-r--r-- | src/widgets/widgets/qmenu.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index ea3e4c4488..744fecb3f3 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -584,7 +584,9 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason if (reason != SelectedFromKeyboard) { if (QMenu *menu = qobject_cast<QMenu*>(causedPopup.widget)) { if (causedPopup.action && menu->d_func()->activeMenu == q) - menu->d_func()->setCurrentAction(causedPopup.action, 0, reason, false); + // Reselect parent menu action only if mouse is over a menu and parent menu action is not already selected (QTBUG-47987) + if (hasReceievedEnter && menu->d_func()->currentAction != causedPopup.action) + menu->d_func()->setCurrentAction(causedPopup.action, 0, reason, false); } } |