Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.5.1, 5.6.3, 5.9.4
-
None
Description
Hi, I think I've run into a bug in the menu handling code (QMenuBar), related to handling of the escape key. I have reproduced this issue on Windows 7 (qt 5.6 and 5.9), and ubuntu 16.04 (qt 5.5). I apologise but I have not tested this in 5.10. I have checked the bug tracker for similar bugs reported and haven't found any.
Platforms use the escape key as one of the keys involved in keyboard navigation of the menus, but it seems you can get to the point of the menus not being open and the escape key isn't passed on to your app anymore.
I've created a test program that is cut down from a full application that is an emulator of a computer system that requires keyboard and mouse handling.
The example program (and my full app) use a keyboard handler on the main window, and a mouse handler on the large display widget inside the main window.
Running the example program
Working example A)
1) run the program
2) With the app having the focus, press the escape key, note the 'Escape is pressed' message displayed in the status bar.
Working example B)
3) Click on the 'File' menu, note that the menu drops down, move the mouse to the 640x480 black area and click in it without moving your mouse over the 'Disc' menu to the right. The menu closes.
4) Press the escape key, note the 'Escape is pressed' message displayed in the status bar.
Failing example C)
5) Click on the 'File' menu, note that the menu drops down, move the mouse right to the 'Disc' menu, note the file menu closes and the disc menu opens. Move the mouse to the 640x480 black area and click in it. The menu closes.
4) BUG Press the escape key, the 'Escape is pressed' message is not displayed in the status bar.