From 82aeceff70a15680c7bae6afb2358a86236d6eef Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Thu, 30 May 2019 12:34:07 +0800 Subject: [PATCH] [Mod] only register event if event_type is specified --- vnpy/trader/ui/widget.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vnpy/trader/ui/widget.py b/vnpy/trader/ui/widget.py index 899aefb9..f59e4c45 100644 --- a/vnpy/trader/ui/widget.py +++ b/vnpy/trader/ui/widget.py @@ -237,8 +237,9 @@ class BaseMonitor(QtWidgets.QTableWidget): """ Register event handler into event engine. """ - self.signal.connect(self.process_event) - self.event_engine.register(self.event_type, self.signal.emit) + if self.event_type: + self.signal.connect(self.process_event) + self.event_engine.register(self.event_type, self.signal.emit) def process_event(self, event): """