Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mherrmann committed Apr 6, 2021
1 parent 2daaf63 commit 4136d26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/07 Qt Text Editor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def closeEvent(self, e):
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()
Expand Down

0 comments on commit 4136d26

Please sign in to comment.