This is a follow on question to Qt - pyside - saveGeometry() saveState()
I have a Qt program and currently I use Qsettings and the mainWindow.saveGeometry() and mainWindow.saveState() functions to allow the program to restore the layout that the user set in the previous session.
This approach works well for the docked position of all the docked windows. It also works well for the floating position of the un-docked windows provided the windows are un-docked at exit.
When a user tailors the position of the floating window to their needs within a session, docking and re-floating the window cause it to successfully restore the users preferred position.
However the problem arises when the user has tailored the size and position of the window and then docks the window and then exits. On restart the window does not recover the users preferred floating position.
None of the suggestions in the answers to the other question linked above are helpful since QdockWidget does not have any getGeom() setGeom() type methods. Neither does it have its own seveGeometry() restoreGeometry() methods. I guess the main window methods are supposed to take care of dockedwidgets too. But the above behaviour falls short of the desired functionality.
I have tried using save and restore methods on the object returned by the widget() method of QdockWidget but that does not work. (It modifies the contents of the QdockWidget and not the position of the floating window)
So I think my refined questions are these:
1) Have others observed the above shortcoming with main window save/restore or might I be doing something to block proper restoring of the docked windows.
2) Is there any way to get and set the floating geometry of the QdockWidget?