diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2013-09-10 20:35:11 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2013-09-10 20:35:11 (GMT) |
commit | 81ea3637b4a49d028fbce47d92de979d0ecd1278 (patch) | |
tree | 0ded38b0c34a44145a732bbc20756ba662636c0c /Source/QtDialog | |
parent | b2ce2f5e485dddd39f6fda04fbb5110e4e279c1c (diff) | |
download | CMake-81ea3637b4a49d028fbce47d92de979d0ecd1278.zip CMake-81ea3637b4a49d028fbce47d92de979d0ecd1278.tar.gz CMake-81ea3637b4a49d028fbce47d92de979d0ecd1278.tar.bz2 |
cmake-gui: save and restore the geometry and window state between sessions.
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 4d62f72..a4dfdc9 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -66,9 +66,8 @@ CMakeSetupDialog::CMakeSetupDialog() // create the GUI QSettings settings; settings.beginGroup("Settings/StartPath"); - int h = settings.value("Height", 500).toInt(); - int w = settings.value("Width", 700).toInt(); - this->resize(w, h); + restoreGeometry(settings.value("geometry").toByteArray()); + restoreState(settings.value("windowState").toByteArray()); this->AddVariableCompletions = settings.value("AddVariableCompletionEntries", QStringList("CMAKE_INSTALL_PREFIX")).toStringList(); @@ -299,8 +298,8 @@ CMakeSetupDialog::~CMakeSetupDialog() { QSettings settings; settings.beginGroup("Settings/StartPath"); - settings.setValue("Height", this->height()); - settings.setValue("Width", this->width()); + settings.setValue("windowState", QVariant(saveState())); + settings.setValue("geometry", QVariant(saveGeometry())); settings.setValue("SplitterSizes", this->Splitter->saveState()); // wait for thread to stop |