[Fix] missing parent when using QMessageBox.critical

This commit is contained in:
vn.py 2019-05-09 16:29:15 +08:00
parent 9557534eaf
commit fb4d7c9c01

View File

@ -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)