Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.2, 5.1.1, 5.2.1, 5.3.1, 5.3.2
-
None
-
Compiled with Visual Studio 2010 and reproduced on three different machines with Windows 7 64 bits and differents graphics cards from Nvidia and AMD.
-
6080db8c6d345cf4ad573215828246e86f9dc41b (qtbase/5.4, 28.10.2014, 5.4)
Description
Look at the attached example. Three top level widgets are created.
1. The first one is a regular widget with a mouse press event handler. If you click on it a menu is shown. If you click again the menu is closed and shown again at the new location. Works as expected.
2. The second widget is a QGLWidget with the same event handler as the first widget and behaves in the same way. Works as expected too.
3. The third widget contains two child widgets with one of each type. If you click on either child widget the menu is shown. But if you click again the menu is closed but not shown again because the event handler is not called. If you click on the top level widget (i.e. on the margin) it works as expected. If you remove the GLWidget it also works as expected on both the parent and child widgets.
This works as expected on all cases with Qt 4.8.
I can also provide some additional hints:
- If you move the widget with the children to the top left corner of the screen, there is a region of the child widgets where you actually obtain the expected behaviour. It looks like it works inside the rectangle of the screen that would be occupied by the child widgets if they were positioned exactly at the top left corner. If you make the window bigger, the region where it works is also bigger.
- When the menu is shown on the child GLWidget, the following warning is printed on the console (only if the menu is a child of GLWidget):
void __thiscall QWindow::setTransientParent(class QWindow *) QWidgetWindow(0xd3a0f8, name = "QWidgetClassWindow") must be a top level window.
- In Qt 5.0.2 this actually fails for all the cases. Maybe the solution for
QTBUG-30707fixed it partially?
Attachments
Issue Links
- relates to
-
QTBUG-39313 Menu bar doesn't handle mouse click properly when there is a QGLWidget/native widget
- Closed
-
QTBUG-34814 MousePress event which closes a popupWidget passed to another widget
- Closed
-
QTBUG-36862 QToolButton remains in hover state after menu closed
- Closed
- replaces
-
QTBUG-42140 [REG] QMenu doesn't open after clicking closed if QGLWidget present
- Closed