移出BASIC_FONT参数,因为其他模块文件找不到这个全局变量

This commit is contained in:
Wisfern 2017-07-25 22:36:30 +08:00
parent aa976efcb8
commit 0120558b12

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图标