Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
-
cc761c85e (dev)
Description
A sub window is a concept coming from Qt Widgets MDI area, which uses plain (non-native) child widgets to represent "top level" windows managed by the MDI "window manager". These widgets have the corresponding Qt::SubWindow flag.
See https://doc.qt.io/qt-6/qmdiarea.html and https://doc.qt.io/qt-6/qmdisubwindow.html
Of course, a QMdiSubWindow can end up with a QWindow via e.g. winId(), in which case the QWindow will also reflect the Qt::SubWindow flag.
But importantly, a QWindow without Qt::SubWindow does not make it a top level. Most child QWindows will not have the Qt::SubWindow flag, and we can't use it as a proxy for the window being a child window.
For example, QWindow::setParent() doesn't toggle Qt::SubWindow based on there being a parent or not.
This means our use of Qt::SubWindow in QPlatformIntegration::defaultWindowState() to determine whether a window should be shown normal instead of fullscreen/maximized on platforms such as iOS/Android is wrong. To fix this we need to either pass the QWindow itself, so we can inspect it's parent, or perhaps ideally just ask the QPlatformWindow directly instead of going through QPlatformIntegration.
There might be other cases where we assume Qt::SubWindow is a child QWindow.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-115729 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
494048,3 | Add note about Qt::SubWindow not being the same as a child window | dev | qt/qtbase | Status: MERGED | +2 | 0 |