diff options
author | Amit Chaudhuri <amit.k.chaudhuri@gmail.com> | 2013-04-28 10:05:37 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-04-28 10:17:53 -0700 |
commit | 4c665be05f7128a5a259fb3b71f3d65019639b1d (patch) | |
tree | 47d9aaab1e614c3d5de3880a0cdfc179a0dcf850 /qt-ui/mainwindow.cpp | |
parent | 4179885da79d4d2ba0a4893331e162235765ad0f (diff) | |
download | subsurface-4c665be05f7128a5a259fb3b71f3d65019639b1d.tar.gz |
Save and retore splitter dimensions.
Rename splitters and remove seemingly redundant empty splitter.
Use save/restoreState to save splitter sizes using QSettings.
Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index c1e15e30c..71ba70525 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -289,9 +289,12 @@ void MainWindow::readSettings() { QSettings settings("hohndel.org","subsurface"); - /* note: section/key i.e. forward slash to separate */ - QSize sz = settings.value("MainWindow/size").value<QSize>(); + settings.beginGroup("MainWindow"); + QSize sz = settings.value("size").value<QSize>(); resize(sz); + ui->mainSplitter->restoreState(settings.value("mainSplitter").toByteArray()); + ui->infoProfileSplitter->restoreState(settings.value("infoProfileSplitter").toByteArray()); + settings.endGroup(); } void MainWindow::writeSettings() @@ -299,6 +302,8 @@ void MainWindow::writeSettings() QSettings settings("hohndel.org","subsurface"); settings.beginGroup("MainWindow"); settings.setValue("size",size()); + settings.setValue("mainSplitter", ui->mainSplitter->saveState()); + settings.setValue("infoProfileSplitter", ui->infoProfileSplitter->saveState()); settings.endGroup(); /* other groups here; avoid '/' and '\' in keys with setValue(...) please */ } |