QMenu behaviour with QMainWindow/QGLWidget
-
Hi,
I am working on an app and observed an odd behaviour with the menu. I wasn't sure if I'd done something to cause it so I reduced it to a simple form. My test case simply creates a QMainWindow, adds a QMenu named "File" with a single item to the menubar and sets the central widget to an empty QGLWidget.
In this case the following occurs:
- "File" is pressed and the menu opens, as expected.
- "File" is pressed again and the menu closes, as expected.
- "File" is pressed again and nothing happens, not as expected.
- "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:
- "File" is pressed and the menu opens, as expected.
- The empty central widget is pressed and the menu closes, as expected.
- "File" is pressed again and the menu opens, as expected. Etc.
If the central widget is swapped for a different widget (I tried a QPushButton), the menu works as I would expect, with each press opening and closing the menu in turn.
Could someone please advise if there is there something extra I need to do when using a QGLWidget? Or is this not the expected behaviour?
Thanks.
-
Hi and welcome to devnet,
Indeed, this is not the expected behavior. What OS/Qt combination are you running ?
-
Thanks.
I'm using Qt Creator 3.0.1 (Qt 5.2.1) with Linux Mint 16 x64.
-
Can you test if you have the same behavior with the latest 5.3 ?
-
I could only find 5.3.0 Alpha. Was that the one to test?
I downloaded and built that. The result was the same as 5.2.1.
-
Yes that's the one (there might also be the beta not far away)
Anyway, you should check the "bug report system":http://bugreports.qt-project.org to see if it's something known. If not you should consider opening a new bug report providing a minimal compilable example that shows the behavior.
-
OK, I'll do that. Thanks for your help.
-
You're welcome !
If you open a bug report, please post a link here so other forum users may find it more easily if they encounter the same problem as you
-
I opened a new bug report "QTBUG-37720.":https://bugreports.qt-project.org/browse/QTBUG-37720
Thanks.