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>
This commit is contained in:
parent
feca69e89f
commit
d36002d046
@ -384,7 +384,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat
|
|||||||
QAction *previousAction = currentAction;
|
QAction *previousAction = currentAction;
|
||||||
#endif
|
#endif
|
||||||
currentAction = action;
|
currentAction = action;
|
||||||
if (action) {
|
if (action && action->isEnabled()) {
|
||||||
activateAction(action, QAction::Hover);
|
activateAction(action, QAction::Hover);
|
||||||
if(popup)
|
if(popup)
|
||||||
popupAction(action, activateFirst);
|
popupAction(action, activateFirst);
|
||||||
@ -1038,7 +1038,7 @@ void QMenuBar::mousePressEvent(QMouseEvent *e)
|
|||||||
d->mouseDown = true;
|
d->mouseDown = true;
|
||||||
|
|
||||||
QAction *action = d->actionAt(e->pos());
|
QAction *action = d->actionAt(e->pos());
|
||||||
if (!action || !d->isVisible(action)) {
|
if (!action || !d->isVisible(action) || !action->isEnabled()) {
|
||||||
d->setCurrentAction(0);
|
d->setCurrentAction(0);
|
||||||
#ifndef QT_NO_WHATSTHIS
|
#ifndef QT_NO_WHATSTHIS
|
||||||
if (QWhatsThis::inWhatsThisMode())
|
if (QWhatsThis::inWhatsThisMode())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user