diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2010-03-02 15:27:46 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2010-03-03 09:52:11 (GMT) |
commit | 60324267fbb8a8554e62aaf9ef01360709292320 (patch) | |
tree | a6463fa53ff7220414ca456909bf397fe059871d /src/gui/widgets | |
parent | 6e0565eaa293b84f7583947822fe5939cb47af89 (diff) | |
download | Qt-60324267fbb8a8554e62aaf9ef01360709292320.zip Qt-60324267fbb8a8554e62aaf9ef01360709292320.tar.gz Qt-60324267fbb8a8554e62aaf9ef01360709292320.tar.bz2 |
Make the sub-menu accessible via its shortcut even if it is the current
Task-number: QTBUG-7411
Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index e2cf25b..5db14b8 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -487,7 +487,7 @@ void QMenuPrivate::popupAction(QAction *action, int delay, bool activateFirst) if (action && action->isEnabled()) { if (!delay) q->internalDelayedPopup(); - else + else if (!QMenuPrivate::menuDelayTimer.isActive() && (!action->menu() || !action->menu()->isVisible())) QMenuPrivate::menuDelayTimer.start(delay, q); if (activateFirst && action->menu()) action->menu()->d_func()->setFirstActionActive(); @@ -543,15 +543,6 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason { Q_Q(QMenu); tearoffHighlighted = 0; - if (action == currentAction) { - if (!action || !action->menu() || action->menu() == activeMenu) { - 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); - } - } - return; - } if (currentAction) q->update(actionRect(currentAction)); @@ -565,6 +556,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason #ifdef QT3_SUPPORT emitHighlighted = action; #endif + currentAction = action; if (action) { if (!action->isSeparator()) { |