How do I show a message box with Yes/No buttons in Qt, and how do I check which of them was pressed?
I.e. a message box that looks like this:

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You would use
QMessageBox::questionfor that.Example in a hypothetical widget’s slot:
Should work on Qt 4 and 5, requires
QT += widgetson Qt 5, andCONFIG += consoleon Win32 to seeqDebug()output.See the
StandardButtonenum to get a list of buttons you can use; the function returns the button that was clicked. You can set a default button with an extra argument (Qt “chooses a suitable default automatically” if you don’t or specifyQMessageBox::NoButton).