2
0
mirror of https://github.com/pyqt/examples.git synced 2025-08-23 10:07:18 +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:
save()
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()
elif answer & QMessageBox.Cancel:
e.ignore()