From fb4d7c9c01f223e6e532a836ed0c7a665a0b15a1 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Thu, 9 May 2019 16:29:15 +0800 Subject: [PATCH] [Fix] missing parent when using QMessageBox.critical --- vnpy/trader/ui/widget.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vnpy/trader/ui/widget.py b/vnpy/trader/ui/widget.py index f0b46b99..899aefb9 100644 --- a/vnpy/trader/ui/widget.py +++ b/vnpy/trader/ui/widget.py @@ -824,12 +824,12 @@ class TradingWidget(QtWidgets.QWidget): """ symbol = str(self.symbol_line.text()) if not symbol: - QtWidgets.QMessageBox.critical("委托失败", "请输入合约代码") + QtWidgets.QMessageBox.critical(self, "委托失败", "请输入合约代码") return volume_text = str(self.volume_line.text()) if not volume_text: - QtWidgets.QMessageBox.critical("委托失败", "请输入委托数量") + QtWidgets.QMessageBox.critical(self, "委托失败", "请输入委托数量") return volume = float(volume_text)