Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.0
-
None
-
Only tested on Ubuntu 20.04.
-
-
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).