Merge pull request #420 from wisfern/for_pr

修改QtUi的BUG,其他模块找不到BASIC_FONT,把BASIC_FONT的初始化从函数内移到函数外
This commit is contained in:
vn.py 2017-07-28 10:03:06 +08:00 committed by GitHub
commit 0c7258fecb

View File

@ -7,6 +7,13 @@ from qtpy import QtWidgets, QtGui, QtCore
from vnpy.trader.vtGlobal import globalSetting
from vnpy.trader.vtFunction import loadIconPath
BASIC_FONT = None
try:
family = globalSetting['fontFamily']
size = globalSetting['fontSize']
BASIC_FONT = QtGui.QFont(family, size)
except:
BASIC_FONT = QtGui.QFont(u'微软雅黑', 12)
#----------------------------------------------------------------------
def createQApp():
@ -28,12 +35,6 @@ def createQApp():
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.trader')
# 设置Qt字体
try:
family = globalSetting['fontFamily']
size = globalSetting['fontSize']
BASIC_FONT = QtGui.QFont(family, size)
except:
BASIC_FONT = QtGui.QFont(u'微软雅黑', 12)
qApp.setFont(BASIC_FONT)
# 设置Qt图标