Solved!
The problem was that I was calling QMainWindow::addDockWidget and specifying Qt::AllDockWidgetAreas, which is nonsense. I changed to calling QMainWindow::addDockWidget and passing Qt::LeftDockWidgetArea and then calling QDockWidget::setFloating(true). This means that the floating QDockWidget is at least associated with a dock widget area and is, as a consequence, considered when calling QMainWindow::saveState.
Rock.
Bookmarks