diff --git a/vnpy/trader/uiQt.py b/vnpy/trader/uiQt.py index 227ffc55..b6af0a13 100644 --- a/vnpy/trader/uiQt.py +++ b/vnpy/trader/uiQt.py @@ -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图标