📜  pyqt5 关闭事件 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:56.293000             🧑  作者: Mango

代码示例1
def closeEvent(self, event):
            close = QtWidgets.QMessageBox.question(self,
                                         "QUIT",
                                         "Are you sure want to stop process?",
                                         QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
            if close == QtWidgets.QMessageBox.Yes:
                event.accept()
            else:
                event.ignore()