From 4136d26d37d91ea94ad1b016ed4be0fe49b40df1 Mon Sep 17 00:00:00 2001 From: Michael Herrmann Date: Tue, 6 Apr 2021 06:20:38 +0200 Subject: [PATCH] Add comment --- src/07 Qt Text Editor/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/07 Qt Text Editor/main.py b/src/07 Qt Text Editor/main.py index e5be646..d07940d 100644 --- a/src/07 Qt Text Editor/main.py +++ b/src/07 Qt Text Editor/main.py @@ -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()