Store the state of the main window when closing and restore it.

master
Salvo 'LtWorf' Tomaselli 2015-06-01 14:20:29 +07:00
parent dbeb1e3863
commit 9d4284d624
1 changed files with 8 additions and 2 deletions

@ -276,13 +276,19 @@ class relForm(QtWidgets.QMainWindow):
event.accept()
def save_settings(self):
# self.settings.setValue("width",)
pass
print('save')
self.settings.setValue('maingui/geometry', self.saveGeometry())
self.settings.setValue('maingui/windowState', self.saveState())
def restore_settings(self):
# self.settings.value('session_name','default').toString()
self.setMultiline(self.settings.value('multiline','false')=='true')
self.ui.txtMultiQuery.setPlainText(self.settings.value('multiline/query',''))
try:
self.restoreGeometry(self.settings.value('maingui/geometry'))
self.restoreState(self.settings.value('maingui/windowState'))
except:
pass
def showSurvey(self):
if self.Survey == None: