Hello everyone,
My System is Ubuntu 12.04 64 Bit with Qt 4.8.1.
I have a QMainWindow with several dock widgets and a hidden central widget, because as the documentation states a QMainWindow without a central widget is not supported. Every dock widget has been assigned an object name. I save the QMainWindow's state and geometry with:
settings->setValue ("MainWindow/geometry", saveGeometry ());
settings->setValue ("MainWindow/windowState", saveState ());
settings->sync ();
settings->setValue ("MainWindow/geometry", saveGeometry ());
settings->setValue ("MainWindow/windowState", saveState ());
settings->sync ();
To copy to clipboard, switch view to plain text mode
and restore it with the following commands:
restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ());
restoreState (settings->value ("MainWindow/windowState").toByteArray ());
restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ());
restoreState (settings->value ("MainWindow/windowState").toByteArray ());
To copy to clipboard, switch view to plain text mode
which is the last thing that I call in my QMainWindow constructor.
Just in case: Since this is a GPL project, you can see the full source code here on branch gui, in the subfolder gui. If you need any excerpts, don't hesitate to ask.
hg clone http://hg.savannah.gnu.org/hgweb/octave/
hg clone http://hg.savannah.gnu.org/hgweb/octave/
To copy to clipboard, switch view to plain text mode
The problem now is, that the central widget now gets centered after restoring the previous state. I tried barely everything, in the end I even save and restored the geometry myself. I have made two screenshots that may clarify what I mean:
This is before saving the state:

This is after restoring, the command window gets shifted to the right, because it is in the RightDockWidgetArea and the central widget (which is hidden), gets centered.

Any ideas on this?
Bookmarks