Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.2.1, 5.3.0 Alpha
-
None
-
Linux Mint 16 x64/Qt Creator 3.0.1/Qt5.2.1 and Qt5.3.0
Description
The behaviour of a QMenu when used with a QMainWindow/QGLWidget does not quite work as expected.
My test case simply creates a QMainWindow, adds a QMenu named “File” with a single item to the menu bar and sets the central widget to an empty QGLWidget.
In this case the following occurs:
1. “File” is pressed and the menu opens, as expected.
2. “File” is pressed again and the menu closes, as expected.
3. “File” is pressed again and nothing happens, not as expected.
4. “File” is pressed again and the menu opens.
This behaviour repeats where only every other press opens the menu. However, the following does appear to work as expected:
1. “File” is pressed and the menu opens, as expected.
2. The empty central widget is pressed and the menu closes, as expected.
3. “File” is pressed again and the menu opens, as expected. Etc.
The menu also appears to work correctly if the menu is used (i.e. an item in the menu is clicked).
If the central widget is swapped for a different widget (I tried a QPushButton), the menu works as I would expect, with each press of the file menu opening and closing the menu in turn.
I have tested the case with Qt5.2.1 and Qt5.3.0 Alpha. The results are the same in both cases.
A simple test case is attached.