From 2427598519afd8b24298516b3bdf2607e169de67 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Wed, 27 May 2020 17:27:12 +0800 Subject: [PATCH] =?UTF-8?q?[bug=20fix]=E4=BF=AE=E5=A4=8Dqygt=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/ui/kline/kline.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vnpy/trader/ui/kline/kline.py b/vnpy/trader/ui/kline/kline.py index e75cef42..f109ed9a 100644 --- a/vnpy/trader/ui/kline/kline.py +++ b/vnpy/trader/ui/kline/kline.py @@ -1427,10 +1427,12 @@ class GridKline(QtWidgets.QWidget): self.kline_names = list(self.kline_settings.keys()) self.kline_dict = {} - self.initUI() + self.init_ui() - def initUI(self): + def init_ui(self): + """""" gridLayout = QtWidgets.QGridLayout() + self.setLayout(gridLayout) for kline_name, kline_setting in self.kline_settings.items(): canvas = KLineWidget(display_vol=False, display_sub=True) @@ -1459,13 +1461,13 @@ class GridKline(QtWidgets.QWidget): if len(kline_names) == 0: break kline_name = kline_names.pop(0) - gridLayout.addWidget(self.kline_dict[kline_name], row, column) + kline_layout = QtWidgets.QVBoxLayout() + kline_layout.addWidget(self.kline_dict[kline_name]) + gridLayout.addLayout(kline_layout, row, column) if len(kline_names) == 0: break row += 1 - self.setLayout(gridLayout) - self.show() self.load_multi_kline()