Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.2.4, 6.4.0
-
None
-
-
1bde20360 (dev), 7a3a94099 (6.5), fb70893dd (dev), 57f44282b (tqtc/lts-6.2), e02758cbf (6.5), 4a16e51bc (dev), ed1def47a (6.6), 4115060fc (tqtc/lts-6.5)
Description
Run the attached example on Mac. The main window has a child window which again has a child. The last child is Window modal, so it should not be possible to interact with anything but that child[*].
Unfortunately it is possible to click the main window and close it by pressing the (red) 'x' in the corner. When that happens the Window is even closed without a close event being delivered (and neither is the virtual QMainWindow::setVisible function called). This can cause programs to end up in unexpected "impossible" states (e.g where no windows are visible but program still running).
This works on e.g Windows (and likely Linux)
[*] See https://doc.qt.io/qt-6/qt.html#WindowModality-enum
Qt::WindowModal (1): The window is modal to a single window hierarchy and blocks input to its parent window, all grandparent windows, and all siblings of its parent and grandparent windows.