From 14f54e06db190f23c56d713df7cea0b84dbdca2e Mon Sep 17 00:00:00 2001 From: tanglei <1022556987@qq.com> Date: Tue, 22 Sep 2020 22:45:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8mac=E4=B8=8A?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=80=80=E5=87=BA=E5=BC=B9=E7=AA=97=20?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=A1=AE=E5=AE=9A=E5=92=8C=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=93=8D=E5=BA=94=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyminer2/pmappmodern.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pyminer2/pmappmodern.py b/pyminer2/pmappmodern.py index ee7f7418..f1f24d49 100644 --- a/pyminer2/pmappmodern.py +++ b/pyminer2/pmappmodern.py @@ -462,8 +462,17 @@ class MainWindow(BaseMainWindow): def closeEvent(self, a0: QCloseEvent) -> None: ''' - 主窗体退出时的事件,包括弹框提示等。 + 主窗体退出时的事件,包括弹框提示等。Mac 上测试点击无法退出,修改为QMessageBox.Warning ''' + reply = QMessageBox(QMessageBox.Warning, '关闭', '是否关闭!') + reply.addButton('确定', QMessageBox.ActionRole) + reply.addButton('取消', QMessageBox.RejectRole) + if reply.exec_() == QMessageBox.RejectRole: + a0.ignore() + return + else: + a0.accept() + """ reply = QMessageBox.question( self, '注意', @@ -475,6 +484,7 @@ class MainWindow(BaseMainWindow): else: a0.ignore() return + """ self.save_layout() self.save_settings() self.close_signal.emit() -- Gitee