mirror of
https://github.com/maicss/PyQt5-Chinese-tutorial.git
synced 2025-01-24 21:12:54 +08:00
Merge pull request #24 from JavierLiu/master
fix crash error: QMessageBox only has StandardButton enum, not Standa…
This commit is contained in:
commit
075cb3c752
@ -282,10 +282,10 @@ class Example(QWidget):
|
||||
def closeEvent(self, event):
|
||||
|
||||
reply = QMessageBox.question(self, 'Message',
|
||||
"Are you sure to quit?", QMessageBox.StandardButtons.Yes |
|
||||
QMessageBox.StandardButtons.No, QMessageBox.StandardButtons.No)
|
||||
"Are you sure to quit?", QMessageBox.StandardButton.Yes |
|
||||
QMessageBox.StandardButton.No, QMessageBox.StandardButton.No)
|
||||
|
||||
if reply == QMessageBox.StandardButtons.Yes:
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
|
||||
event.accept()
|
||||
else:
|
||||
|
@ -280,10 +280,10 @@ class Example(QWidget):
|
||||
def closeEvent(self, event):
|
||||
|
||||
reply = QMessageBox.question(self, 'Message',
|
||||
"Are you sure to quit?", QMessageBox.StandardButtons.Yes |
|
||||
QMessageBox.StandardButtons.No, QMessageBox.StandardButtons.No)
|
||||
"Are you sure to quit?", QMessageBox.StandardButton.Yes |
|
||||
QMessageBox.StandardButton.No, QMessageBox.StandardButton.No)
|
||||
|
||||
if reply == QMessageBox.StandardButtons.Yes:
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
|
||||
event.accept()
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user