diff --git a/src/07 Qt Text Editor/main.py b/src/07 Qt Text Editor/main.py index 06caccf..e5be646 100644 --- a/src/07 Qt Text Editor/main.py +++ b/src/07 Qt Text Editor/main.py @@ -12,6 +12,8 @@ class MainWindow(QMainWindow): ) if answer & QMessageBox.Save: save() + if text.document().isModified(): + event.ignore() elif answer & QMessageBox.Cancel: e.ignore() @@ -76,4 +78,4 @@ def show_about_dialog(): about_action.triggered.connect(show_about_dialog) window.show() -app.exec_() \ No newline at end of file +app.exec_()