Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
einsteinathome
pulsatingscience
Commits
b5c71b20
Commit
b5c71b20
authored
Jul 30, 2010
by
Oliver Bock
Browse files
Save/restore window state and layout (on quit/startup)
parent
5d8927f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pulsatingscience.cpp
View file @
b5c71b20
...
...
@@ -19,6 +19,8 @@
******************************************************************************/
#include
"pulsatingscience.h"
#include
<QSettings>
#ifdef __APPLE__
#include
"/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/Carbon.h"
...
...
@@ -110,6 +112,16 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
connect
(
m_hiddenShortcut
,
SIGNAL
(
activated
()),
this
,
SLOT
(
toggleHiddenDemoMode
()));
// restore previously saved window and splitter layout
QCoreApplication
::
setOrganizationName
(
"Max-Planck-Insitut für Gravitationsphysik"
);
QCoreApplication
::
setOrganizationDomain
(
"aei.mpg.de"
);
QCoreApplication
::
setApplicationName
(
"Pulsating Science"
);
QSettings
settings
;
restoreGeometry
(
settings
.
value
(
"windowGeometry"
).
toByteArray
());
restoreState
(
settings
.
value
(
"windowState"
).
toByteArray
());
ui
.
splitter
->
restoreState
(
settings
.
value
(
"splitterSizes"
).
toByteArray
());
}
PulsatingScience
::~
PulsatingScience
()
...
...
@@ -161,6 +173,12 @@ void PulsatingScience::closeEvent(QCloseEvent *event)
event
->
ignore
();
}
else
{
// save splitter layout
QSettings
settings
;
settings
.
setValue
(
"windowGeometry"
,
saveGeometry
());
settings
.
setValue
(
"windowState"
,
saveState
());
settings
.
setValue
(
"splitterSizes"
,
ui
.
splitter
->
saveState
());
event
->
accept
();
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment