Merge pull request #24 from JavierLiu/master

fix crash error: QMessageBox only has StandardButton enum, not Standa…
This commit is contained in:
maicss 2022-04-04 15:38:06 +08:00 committed by GitHub
commit 075cb3c752
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -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:

View File

@ -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: