Skip to content

Commit

Permalink
Fix small bug in text editor
Browse files Browse the repository at this point in the history
Thanks to @Day0Dreamer for the PR!
  • Loading branch information
mherrmann authored Apr 6, 2021
2 parents 5225c0e + 3006561 commit 2daaf63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/07 Qt Text Editor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def closeEvent(self, e):
)
if answer & QMessageBox.Save:
save()
if text.document().isModified():
event.ignore()
elif answer & QMessageBox.Cancel:
e.ignore()

Expand Down Expand Up @@ -76,4 +78,4 @@ def show_about_dialog():
about_action.triggered.connect(show_about_dialog)

window.show()
app.exec_()
app.exec_()

0 comments on commit 2daaf63

Please sign in to comment.