From 549f19be00f4d72504a6f45cb8d83373b3e96dd2 Mon Sep 17 00:00:00 2001 From: chenxy123 Date: Sat, 30 Apr 2016 10:11:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=80=E5=87=BA=E6=97=B6?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=8A=B6=E6=80=81=E4=B8=8D=E8=83=BD=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.trader/uiMainWindow.py | 3 +++ vn.trader/vtMain.py | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/vn.trader/uiMainWindow.py b/vn.trader/uiMainWindow.py index 4f9fa02e..1624d651 100644 --- a/vn.trader/uiMainWindow.py +++ b/vn.trader/uiMainWindow.py @@ -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: diff --git a/vn.trader/vtMain.py b/vn.trader/vtMain.py index 554b1fd7..bf52abe3 100644 --- a/vn.trader/vtMain.py +++ b/vn.trader/vtMain.py @@ -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)