From cbdfeada5067929e41fac19d87dd6f342b47c8b0 Mon Sep 17 00:00:00 2001 From: chenxy123 Date: Mon, 5 Dec 2016 21:40:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4IbGateway=E5=AF=B9=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E6=97=A5=E5=BF=97=E4=BF=A1=E6=81=AF=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.trader/ibGateway/ibGateway.py | 2 +- vn.trader/uiBasicWidget.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vn.trader/ibGateway/ibGateway.py b/vn.trader/ibGateway/ibGateway.py index bb3f4629..1d39e098 100644 --- a/vn.trader/ibGateway/ibGateway.py +++ b/vn.trader/ibGateway/ibGateway.py @@ -335,7 +335,7 @@ class IbWrapper(IbApi): err = VtErrorData() err.gatewayName = self.gatewayName err.errorID = errorCode - err.errorMsg = errorString + err.errorMsg = errorString.decode('GBK') self.gateway.onError(err) #---------------------------------------------------------------------- diff --git a/vn.trader/uiBasicWidget.py b/vn.trader/uiBasicWidget.py index 43c8005c..d28b48bf 100644 --- a/vn.trader/uiBasicWidget.py +++ b/vn.trader/uiBasicWidget.py @@ -288,7 +288,7 @@ class BasicMonitor(QtGui.QTableWidget): if key not in self.dataDict: self.insertRow(0) d = {} - for n, header in enumerate(self.headerList): + for n, header in enumerate(self.headerList): content = safeUnicode(data.__getattribute__(header)) cellType = self.headerDict[header]['cellType'] cell = cellType(content, self.mainEngine) @@ -323,10 +323,10 @@ class BasicMonitor(QtGui.QTableWidget): if self.font: cell.setFont(self.font) - if self.saveData: + if self.saveData: cell.data = data - self.setItem(0, n, cell) + self.setItem(0, n, cell) # 调整列宽 self.resizeColumns()