修复退出时窗口状态不能保存的bug
This commit is contained in:
parent
ff501eca46
commit
549f19be00
@ -22,6 +22,7 @@ class MainWindow(QtGui.QMainWindow):
|
||||
self.widgetDict = {} # 用来保存子窗口的字典
|
||||
|
||||
self.initUi()
|
||||
self.loadWindowSettings()
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
def initUi(self):
|
||||
@ -273,6 +274,8 @@ class MainWindow(QtGui.QMainWindow):
|
||||
if reply == QtGui.QMessageBox.Yes:
|
||||
for widget in self.widgetDict.values():
|
||||
widget.close()
|
||||
self.saveWindowSettings()
|
||||
|
||||
self.mainEngine.exit()
|
||||
event.accept()
|
||||
else:
|
||||
|
@ -10,13 +10,13 @@ from uiMainWindow import *
|
||||
#----------------------------------------------------------------------
|
||||
def main():
|
||||
"""主程序入口"""
|
||||
# 设置底部任务栏图标,win7以下请注释掉
|
||||
if platform.uname() == 'Windows':
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.py demo')
|
||||
|
||||
# Reload sys, Set default encode to UTF8
|
||||
# 重载sys模块,设置默认字符串编码方式为utf8
|
||||
reload(sys)
|
||||
sys.setdefaultencoding('utf8')
|
||||
|
||||
# 设置Windows底部任务栏图标
|
||||
if platform.uname() == 'Windows':
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.trader')
|
||||
|
||||
# 初始化Qt应用对象
|
||||
app = QtGui.QApplication(sys.argv)
|
||||
|
Loading…
Reference in New Issue
Block a user