2
0
mirror of https://github.com/pyqt/examples.git synced 2025-08-30 13:27:42 +00:00

Bug fix proposal

Suppose you type Lorem, try to exit, get Save as dialogue, close it and app closes on you.

I think we should add a check about it (And give the book a fix too :))
This commit is contained in:
Day0Dreamer 2021-03-27 21:21:50 +01:00 committed by GitHub
parent 5225c0e7f0
commit 3006561081
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:
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_()
app.exec_()