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>
bb10
Michal Policht 2015-09-23 19:13:10 +02:00 committed by Shawn Rutledge
parent 157445e64a
commit c7c7a22bb4
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}
}