Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
4.8.7, 5.4.2, 5.5.0
-
None
-
63949183f04ee953198e6544912404701151a98b
Description
Our Qt application with customised UI allows user to rearrange content widgets as tabbed, standalone MDI, etc. For example, user can drag'n'drop some content widget from MDI window to Tabbet Window, so we execute code like this:
mdiArea->removeSubWindow(baseWidget); baseWidget->setParent(tabbedWindow);
But removeSubWindow calls baseWidget->setParent(0) also, so parent of our widget is changed twice. Note that setParent(0) turns our widget as top-level window, so there are a lot of side effects with geometry, layouts, so on.
We can avoid those bugs to change our code:
baseWidget->setParent(tabbedWindow); mdiArea->removeSubWindow(baseWidget);
and exclude setParent(0) from removeSubWindow() if parent of base widget is already changed.