2
0
mirror of https://github.com/pyqt/examples.git synced 2025-08-23 18:17:10 +00:00

Add comment

This commit is contained in:
Michael Herrmann 2021-04-06 06:20:38 +02:00
parent 2daaf639ac
commit 4136d26d37

View File

@ -13,6 +13,9 @@ class MainWindow(QMainWindow):
if answer & QMessageBox.Save: if answer & QMessageBox.Save:
save() save()
if text.document().isModified(): if text.document().isModified():
# This happens when the user closes the Save As... dialog.
# We do not want to close the window in this case because it
# would throw away unsaved changes.
event.ignore() event.ignore()
elif answer & QMessageBox.Cancel: elif answer & QMessageBox.Cancel:
e.ignore() e.ignore()