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:
parent
5225c0e7f0
commit
3006561081
@ -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_()
|
||||
|
Loading…
x
Reference in New Issue
Block a user