Azad Rasul
SmartRS

SmartRS

18- Building a dialog box

Azad Rasul's photo
Azad Rasul
·Jun 25, 2021·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Listen to this article

Building a dialog box to asking want to save changes:

qmb = QMessageBox()
qmb.setText('Want to save your changes?')
qmb.setStandardButtons(QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel)
return_value = qmb.exec()

if return_value == QMessageBox.Save:
    print("You pressed Save")
elif return_value == QMessageBox.Discard:
    print("You pressed Discard")
else:
    print('You pressed Cancel')

If you like the content, please SUBSCRIBE to my channel for the future content

 
Share this