forked from M-Labs/artiq
1
0
Fork 0

gui: save/restore main window geometry

This commit is contained in:
Sebastien Bourdeauducq 2016-02-14 23:08:14 +01:00
parent d81ce15869
commit cd732718ad
1 changed files with 6 additions and 2 deletions

View File

@ -47,10 +47,14 @@ class MainWindow(QtGui.QMainWindow):
self.exit_request.set() self.exit_request.set()
def save_state(self): def save_state(self):
return bytes(self.saveState()) return {
"state": bytes(self.saveState()),
"geometry": bytes(self.saveGeometry())
}
def restore_state(self, state): def restore_state(self, state):
self.restoreState(QtCore.QByteArray(state)) self.restoreGeometry(QtCore.QByteArray(state["geometry"]))
self.restoreState(QtCore.QByteArray(state["state"]))
def main(): def main():