How to get the button event of the Qmessage box?
If cancel button is clicked, it should reject?? How to reject the process when cancel button is pressed in the message box??
Printable View
How to get the button event of the Qmessage box?
If cancel button is clicked, it should reject?? How to reject the process when cancel button is pressed in the message box??
please read the documentation of QMessageBox. If you are using static methods, evaluate the return value. if you use exec(), you get the clicked button with "QAbstractButton * clickedButton () const".
the part of "rejecting the process" has nothing to do with qt, that's part of your program logic.
You can QDialog::exec the message box and test for the result:
Hope this is useful.
Regards,
Wladek
This works fine.