Skip to content

Commit

Permalink
[Mod] change QtCore.pyqtSignal to QtCore.Signal
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy committed May 1, 2022
1 parent 8f08046 commit dfa1f60
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

1. 升级tzlocal库的版本到4.2,消除get_localzone()函数的warning
2. 完善代码中函数和变量类型提示
3. 使用QtCore.Signal代替老的QtCore.pyqtSignal

## 修复

Expand Down
6 changes: 3 additions & 3 deletions vnpy/trader/ui/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def init_menu(self) -> None:

gateway_names: list = self.main_engine.get_all_gateway_names()
for name in gateway_names:
func = partial(self.connect, name)
func: Callable = partial(self.connect, name)
self.add_action(
sys_menu,
f"连接{name}",
Expand All @@ -123,9 +123,9 @@ def init_menu(self) -> None:
all_apps: List[BaseApp] = self.main_engine.get_all_apps()
for app in all_apps:
ui_module: ModuleType = import_module(app.app_module + ".ui")
widget_class = getattr(ui_module, app.widget_name)
widget_class: QtWidgets.QWidget = getattr(ui_module, app.widget_name)

func = partial(self.open_widget, widget_class, app.app_name)
func: Callable = partial(self.open_widget, widget_class, app.app_name)

self.add_action(app_menu, app.display_name, app.icon_name, func, True)

Expand Down
2 changes: 1 addition & 1 deletion vnpy/trader/ui/qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def excepthook(exctype: type, value: Exception, tb: types.TracebackType) -> None

class ExceptionWidget(QtWidgets.QWidget):
""""""
signal: QtCore.Signal = QtCore.pyqtSignal(str)
signal: QtCore.Signal = QtCore.Signal(str)

def __init__(self, parent: QtWidgets.QWidget = None) -> None:
""""""
Expand Down
4 changes: 2 additions & 2 deletions vnpy/trader/ui/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class BaseMonitor(QtWidgets.QTableWidget):
sorting: bool = False
headers: dict = {}

signal: QtCore.Signal = QtCore.pyqtSignal(Event)
signal: QtCore.Signal = QtCore.Signal(Event)

def __init__(self, main_engine: MainEngine, event_engine: EventEngine) -> None:
""""""
Expand Down Expand Up @@ -660,7 +660,7 @@ class TradingWidget(QtWidgets.QWidget):
General manual trading widget.
"""

signal_tick: QtCore.Signal = QtCore.pyqtSignal(Event)
signal_tick: QtCore.Signal = QtCore.Signal(Event)

def __init__(self, main_engine: MainEngine, event_engine: EventEngine) -> None:
""""""
Expand Down

0 comments on commit dfa1f60

Please sign in to comment.