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()