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

QMdiArea::TabbedView not honored with single subwindow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.0 FF
    • 6.5.0
    • Widgets: Main Window
    • None
    • Only tested on Ubuntu 20.04.
    • Linux/Other display system
    • c94bcecb2 (dev)

    Description

      QMdiArea::TabbedView is not honored when a single subwindow is added to the mdi area.
       
      The subwindow is drawn as a window (with a window frame), although the tab bar is drawn and a tab exists to represent that window. If I maximize the window through the gui when the program is running, then the TabbedView property is honored again (window frame disappears, and the widget is rendered as part of the tab).
      Note that if two or more subwindows are added instead of a single one, then the issue does not appear.

      You will find a workaround in the enclosed snippet, which simply adds a temporary second subwindow to trigger the desired behavior.

      Also, the problem does not appear when the subwindow is added after the window containing the mdi area is shown. Note that this workaround may be complicated to implement on some code bases, when some external code builds an already populated QMdiArea before it is added to its parent widget (which is already shown).

      Attachments

        1. Screenshot from 2023-06-02 15-15-46.png
          7 kB
          Sébastien Bini
        2. main-1.cpp
          0.7 kB
          Sébastien Bini
        3. CMakeLists.txt
          0.3 kB
          Sébastien Bini
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            laugilus Sébastien Bini
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes