I'm having poblems with QMainWindow::saveState when QDockWidgets are nested or tabbed. If I float one of the nested/tabbed QDockWidgets and then call QMainWindow::restoreState, the floating QDockWidget state is not restored and it is left floating.

So these are the steps:
  • Call QMainWindow::saveState on a main window with two docked QDockWidgets which are nested/tabbed
  • Float one of the nested/tabbed QDockWidgets, i.e. one is docked and the other is floating
  • Call QMainWindow::restoreState


EXPECT: Both QDockWidgets to be nested/tabbed as they were when QMainWindow::saveState was called.
ACTUAL: The nested/tabbed state of the QDockWidget is not restored - it's left floating.

Has anyone noticed this behaviour before?