diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-02-07 17:16:29 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-02-07 17:16:29 +0000 |
commit | 9f7682c3cd103379af2916ef83e4a24010ae67c4 (patch) | |
tree | 455d607b5361bd632d8df957c97d886dfa2b17a3 /gpgwin.cpp | |
parent | updated TODO (diff) | |
download | gpg4usb-9f7682c3cd103379af2916ef83e4a24010ae67c4.tar.gz gpg4usb-9f7682c3cd103379af2916ef83e4a24010ae67c4.zip |
experiment with QSettings, store & restore size and location of mainwindow, save settings to appplication path
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@272 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'gpgwin.cpp')
-rw-r--r-- | gpgwin.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -54,6 +54,14 @@ GpgWin::GpgWin() setToolButtonStyle(Qt::ToolButtonTextUnderIcon); setIconSize(QSize(32, 32)); setCurrentFile(""); + + // Restore window size & location + // TODO: is this a good idea for a portable app? screen size & resolution may vary + QSettings settings; + QPoint pos = settings.value("pos", QPoint(100, 100)).toPoint(); + QSize size = settings.value("size", QSize(800, 450)).toSize(); + resize(size); + move(pos); //mKeyList->addMenuAction(deleteSelectedKeysAct); mKeyList->addMenuAction(appendSelectedKeysAct); @@ -261,6 +269,10 @@ void GpgWin::closeEvent(QCloseEvent *event) } else { event->ignore(); } + + QSettings settings; + settings.setValue("pos", pos()); + settings.setValue("size", size()); } void GpgWin::open() |