From f68d36436566e3637400399f53c24efd431b1b28 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Mon, 20 May 2019 21:30:09 +0800 Subject: [PATCH] [Add] clear log function for CTA manager --- vnpy/app/cta_strategy/ui/widget.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vnpy/app/cta_strategy/ui/widget.py b/vnpy/app/cta_strategy/ui/widget.py index f7ba697d..12354487 100644 --- a/vnpy/app/cta_strategy/ui/widget.py +++ b/vnpy/app/cta_strategy/ui/widget.py @@ -56,6 +56,9 @@ class CtaManager(QtWidgets.QWidget): stop_button = QtWidgets.QPushButton("全部停止") stop_button.clicked.connect(self.cta_engine.stop_all_strategies) + clear_button = QtWidgets.QPushButton("清空日志") + clear_button.clicked.connect(self.clear_log) + self.scroll_layout = QtWidgets.QVBoxLayout() self.scroll_layout.addStretch() @@ -80,6 +83,7 @@ class CtaManager(QtWidgets.QWidget): hbox1.addWidget(init_button) hbox1.addWidget(start_button) hbox1.addWidget(stop_button) + hbox1.addWidget(clear_button) grid = QtWidgets.QGridLayout() grid.addWidget(scroll_area, 0, 0, 2, 1) @@ -145,6 +149,10 @@ class CtaManager(QtWidgets.QWidget): class_name, strategy_name, vt_symbol, setting ) + def clear_log(self): + """""" + self.log_monitor.setRowCount(0) + def show(self): """""" self.showMaximized()