summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmenu.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-03-02 15:27:46 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-03-03 09:52:11 (GMT)
commit60324267fbb8a8554e62aaf9ef01360709292320 (patch)
treea6463fa53ff7220414ca456909bf397fe059871d /src/gui/widgets/qmenu.cpp
parent6e0565eaa293b84f7583947822fe5939cb47af89 (diff)
downloadQt-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/qmenu.cpp')
-rw-r--r--src/gui/widgets/qmenu.cpp12
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()) {