diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-04-17 08:31:45 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-17 13:54:34 (GMT) |
commit | 00fa49b42ea931c3f8b2bb46e490fccf28e44744 (patch) | |
tree | 8bb946a366318f7e38464622f498adaa2a653d8e /src | |
parent | 6a3d99ff1747f725fbdfba0353eb74175156fab8 (diff) | |
download | Qt-00fa49b42ea931c3f8b2bb46e490fccf28e44744.zip Qt-00fa49b42ea931c3f8b2bb46e490fccf28e44744.tar.gz Qt-00fa49b42ea931c3f8b2bb46e490fccf28e44744.tar.bz2 |
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')
-rw-r--r-- | src/gui/widgets/qtoolbutton.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/widgets/qtoolbutton.cpp b/src/gui/widgets/qtoolbutton.cpp index f54d66e..bd74bed 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(); |