From 71c9db3e478b18db4fe0d9edfce57d6a449ef341 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 9 Jan 2018 17:55:07 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=E4=BF=AE=E5=A4=8DrunCtaTrading=E6=BD=9C?= =?UTF-8?q?=E5=9C=A8=E7=BC=96=E7=A0=81=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/CtaTrading/runCtaTrading.py | 4 ++++ vnpy/trader/uiMainWindow.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/examples/CtaTrading/runCtaTrading.py b/examples/CtaTrading/runCtaTrading.py index b34960d9..7f315e08 100644 --- a/examples/CtaTrading/runCtaTrading.py +++ b/examples/CtaTrading/runCtaTrading.py @@ -1,5 +1,9 @@ # encoding: UTF-8 +import sys +reload(sys) +sys.setdefaultencoding('utf8') + import multiprocessing from time import sleep from datetime import datetime, time diff --git a/vnpy/trader/uiMainWindow.py b/vnpy/trader/uiMainWindow.py index 9d97f60d..38f52333 100644 --- a/vnpy/trader/uiMainWindow.py +++ b/vnpy/trader/uiMainWindow.py @@ -112,6 +112,10 @@ class MainWindow(QtWidgets.QMainWindow): appMenu = menubar.addMenu(vtText.APPLICATION) for appDetail in self.appDetailList: + # 如果没有应用界面,则不添加菜单按钮 + if not appDetail['appWidget']: + continue + function = self.createOpenAppFunction(appDetail) action = self.createAction(appDetail['appDisplayName'], function, loadIconPath(appDetail['appIco'])) appMenu.addAction(action)