summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2014-04-07 19:13:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-06 16:35:56 +0200
commitd36002d04665dc0db6985fae02fae31d712663cb (patch)
tree2a81d4c977107cc7e96db2e7ee53bf977b232a96 /src
parentfeca69e89f994e0353a86df224d20bde008ff6c2 (diff)
Prevent interaction with a disabled menu in the menubar
When moving the mouse over a disabled menu it could appear to be usable but it should not show any interaction at all. Task-number: QTBUG-31688 Task-number: QTBUG-37488 Change-Id: I9e6594b40e8b209146d8c3705750dfd75f1258c5 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qmenubar.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 729e08c7a5..f523ac2777 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -384,7 +384,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat
QAction *previousAction = currentAction;
#endif
currentAction = action;
- if (action) {
+ if (action && action->isEnabled()) {
activateAction(action, QAction::Hover);
if(popup)
popupAction(action, activateFirst);
@@ -1038,7 +1038,7 @@ void QMenuBar::mousePressEvent(QMouseEvent *e)
d->mouseDown = true;
QAction *action = d->actionAt(e->pos());
- if (!action || !d->isVisible(action)) {
+ if (!action || !d->isVisible(action) || !action->isEnabled()) {
d->setCurrentAction(0);
#ifndef QT_NO_WHATSTHIS
if (QWhatsThis::inWhatsThisMode())