mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 19:28:26 +08:00
gui: save/restore main window geometry
This commit is contained in:
parent
d81ce15869
commit
cd732718ad
@ -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():
|
||||||
|
Loading…
Reference in New Issue
Block a user