summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorYulong Bai <yulong.bai@qt.io>2017-12-27 15:40:16 +0100
committerYulong Bai <yulong.bai@qt.io>2018-01-24 14:24:41 +0000
commit2a3f226e325f3ff8456273444a281349cbbd680f (patch)
treeb0b08c5832ff6e6cd95162d86d828442d8092710 /src/widgets/widgets
parent4ca0d764546908dd31fc3794ddcead5582436097 (diff)
QMenuBar::mouseReleaseEvent: fix triggering hidden actions
While menubar actions are hidden, as menubar was too narrow to contain them, by clicking the blank area, where the action was supposed to place, can still trigger the action. Task-number: QTBUG-65488 Change-Id: I6b137e0717f634ebd3371dbcc2c1ce2089688374 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qmenubar.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 0c11afdc61..b0a75288e8 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -1080,6 +1080,10 @@ void QMenuBar::mouseReleaseEvent(QMouseEvent *e)
d->mouseDown = false;
QAction *action = d->actionAt(e->pos());
+
+ // do noting if the action is hidden
+ if (!d->isVisible(action))
+ return;
if((d->closePopupMode && action == d->currentAction) || !action || !action->menu()) {
//we set the current action before activating
//so that we let the leave event set the current back to 0