summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-04-17 10:31:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-17 15:54:34 +0200
commit00fa49b42ea931c3f8b2bb46e490fccf28e44744 (patch)
tree8bb946a366318f7e38464622f498adaa2a653d8e /src/gui/widgets
parent6a3d99ff1747f725fbdfba0353eb74175156fab8 (diff)
downloadqt4-tools-00fa49b42ea931c3f8b2bb46e490fccf28e44744.tar.gz
Prevent recursions when triggering menus in QToolButton
With a global shortcut set it would be possible to let the button re-open the menu again and again, each time spinning an event loop. Backport of f5ea183cc6a6cd66fb3f804041fc112687e0a060 from qtbase Task-number: QTBUG-30399 Change-Id: If7eddc115c77fef3df3e751fd72e7414cedaf272 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qtoolbutton.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/widgets/qtoolbutton.cpp b/src/gui/widgets/qtoolbutton.cpp
index f54d66e67d..bd74bed6b6 100644
--- a/src/gui/widgets/qtoolbutton.cpp
+++ b/src/gui/widgets/qtoolbutton.cpp
@@ -856,6 +856,9 @@ void QToolButton::showMenu()
d->menuButtonDown = false;
return; // no menu to show
}
+ // prevent recursions spinning another event loop
+ if (d->menuButtonDown)
+ return;
d->menuButtonDown = true;
repaint();