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>
This commit is contained in:
parent
2ddbba9ba9
commit
f5ea183cc6
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user