From d36002d04665dc0db6985fae02fae31d712663cb Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 7 Apr 2014 19:13:59 +0200 Subject: 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 --- src/widgets/widgets/qmenubar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets/qmenubar.cpp') 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()) -- cgit v1.2.3