diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-04-16 17:51:33 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-16 19:45:11 +0200 |
commit | f5ea183cc6a6cd66fb3f804041fc112687e0a060 (patch) | |
tree | 3fb17642f7ecc1d9876d6bc7354141f7019cc946 /src/widgets/widgets/qtoolbutton.cpp | |
parent | 2ddbba9ba9709090de7ffbd00d0127cb3cca0869 (diff) |
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.
Task-number: QTBUG-30399
Change-Id: If7eddc115c77fef3df3e751fd72e7414cedaf272
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/widgets/widgets/qtoolbutton.cpp')
-rw-r--r-- | src/widgets/widgets/qtoolbutton.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp index 88690f8bff..f08689cb9b 100644 --- a/src/widgets/widgets/qtoolbutton.cpp +++ b/src/widgets/widgets/qtoolbutton.cpp @@ -680,6 +680,10 @@ 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(); |