Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-115729

Clean up use of Qt::SubWindow to represent plain child windows



    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • QPA
    • None
    • cc761c85e (dev)


      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.


        For Gerrit Dashboard: QTBUG-115729
        # Subject Branch Project Status CR V



            vestbo Tor Arne Vestbø
            vestbo Tor Arne Vestbø
            0 Vote for this issue
            1 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes