From 2dc7188407631895efb1d900f947825030507e29 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 6 Jun 2017 11:24:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=AApyqt5?= =?UTF-8?q?=E5=92=8Cpyqt4=E4=B8=8D=E5=85=BC=E5=AE=B9=E7=9A=84=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/app/dataRecorder/uiDrWidget.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vnpy/trader/app/dataRecorder/uiDrWidget.py b/vnpy/trader/app/dataRecorder/uiDrWidget.py index c44dd6b8..49833179 100644 --- a/vnpy/trader/app/dataRecorder/uiDrWidget.py +++ b/vnpy/trader/app/dataRecorder/uiDrWidget.py @@ -64,7 +64,6 @@ class DrEngineManager(QtWidgets.QWidget): self.tickTable.setColumnCount(2) self.tickTable.verticalHeader().setVisible(False) self.tickTable.setEditTriggers(QtWidgets.QTableWidget.NoEditTriggers) - self.tickTable.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch) self.tickTable.setAlternatingRowColors(True) self.tickTable.setHorizontalHeaderLabels([text.CONTRACT_SYMBOL, text.GATEWAY]) @@ -73,7 +72,6 @@ class DrEngineManager(QtWidgets.QWidget): self.barTable.setColumnCount(2) self.barTable.verticalHeader().setVisible(False) self.barTable.setEditTriggers(QtWidgets.QTableWidget.NoEditTriggers) - self.barTable.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch) self.barTable.setAlternatingRowColors(True) self.barTable.setHorizontalHeaderLabels([text.CONTRACT_SYMBOL, text.GATEWAY]) @@ -82,7 +80,6 @@ class DrEngineManager(QtWidgets.QWidget): self.activeTable.setColumnCount(2) self.activeTable.verticalHeader().setVisible(False) self.activeTable.setEditTriggers(QtWidgets.QTableWidget.NoEditTriggers) - self.activeTable.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch) self.activeTable.setAlternatingRowColors(True) self.activeTable.setHorizontalHeaderLabels([text.DOMINANT_SYMBOL, text.CONTRACT_SYMBOL]) @@ -148,6 +145,10 @@ class DrEngineManager(QtWidgets.QWidget): self.activeTable.insertRow(0) self.activeTable.setItem(0, 0, TableCell(activeSymbol)) self.activeTable.setItem(0, 1, TableCell(symbol)) + + self.tickTable.resizeColumnsToContents() + self.barTable.resizeColumnsToContents() + self.activeTable.resizeColumnsToContents()