From 3d67aa36f05dd1eb54264f4cd1360f7c97541c2e Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Sat, 12 May 2018 17:44:34 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=E4=BF=AE=E5=A4=8D=E4=B8=A4=E4=B8=AAbug=20?= =?UTF-8?q?#861?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/app/spreadTrading/uiStWidget.py | 6 +++++- vnpy/trader/gateway/xspeedGateway/xspeedGateway.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/vnpy/trader/app/spreadTrading/uiStWidget.py b/vnpy/trader/app/spreadTrading/uiStWidget.py index a6881378..7f505c8b 100644 --- a/vnpy/trader/app/spreadTrading/uiStWidget.py +++ b/vnpy/trader/app/spreadTrading/uiStWidget.py @@ -440,8 +440,12 @@ class StAlgoManager(QtWidgets.QTableWidget): u'状态'] self.setColumnCount(len(headers)) self.setHorizontalHeaderLabels(headers) - self.horizontalHeader().setResizeMode(QtWidgets.QHeaderView.Stretch) + try: + self.horizontalHeader().setResizeMode(QtWidgets.QHeaderView.Stretch) + except AttributeError: + self.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch) + self.verticalHeader().setVisible(False) self.setEditTriggers(self.NoEditTriggers) diff --git a/vnpy/trader/gateway/xspeedGateway/xspeedGateway.py b/vnpy/trader/gateway/xspeedGateway/xspeedGateway.py index dd46ffef..0d5c883c 100644 --- a/vnpy/trader/gateway/xspeedGateway/xspeedGateway.py +++ b/vnpy/trader/gateway/xspeedGateway/xspeedGateway.py @@ -8,6 +8,7 @@ import os import json import time from copy import copy +from time import sleep from vnpy.api.xspeed import MdApi, TdApi, defineDict from vnpy.trader.vtGateway import *