2
0
mirror of https://github.com/pyqt/examples.git synced 2025-08-29 12:57:41 +00:00

Fix small bug in text editor

Thanks to @Day0Dreamer for the PR!
This commit is contained in:
Michael Herrmann 2021-04-06 06:18:30 +02:00 committed by GitHub
commit 2daaf639ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,8 @@ class MainWindow(QMainWindow):
) )
if answer & QMessageBox.Save: if answer & QMessageBox.Save:
save() save()
if text.document().isModified():
event.ignore()
elif answer & QMessageBox.Cancel: elif answer & QMessageBox.Cancel:
e.ignore() e.ignore()