Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.3
-
None
Description
When calling QMenu::exec() there is a possibility to stuck in the local event loop. E.g.:
QMenu::exec() internally calls popup(), which actually creates the menu popup and thus leads to focus out event on other widgets. Other widgets could react on this focus out event and e.g. set focus back. This will call QMenu::hideEvent() where the event loop will be exited. After leaving the popup() call, the local event loop gets started, although QMenu::hideEvent() already called.
Fix would be to not start local event loop in QMenu::exec() when QMenu::hideEvent() already called. E.g. reset d->eventLoop to nullptr in QMenu::hideEvent() and check for nullptr in QMenu::exec() and don't start event loop in that case.