[Interest] QMessageBox - Accept/Reject

Igor Mironchik igor.mironchik at gmail.com
Fri Apr 28 21:24:07 CEST 2017


Hi,


28.04.2017 22:03, André Somers пишет:
>
>> Op 28 apr. 2017 om 20:34 heeft Konstantin Shegunov <kshegunov at gmail.com> het volgende geschreven:
>>
>> Hi,
>> Employ like this:
>>
>> dlg.exec();
>> if (dlg.clickedButton() == btn)
>>     qDebug() << "Yes was clicked";
>>
>> However, why not make use of the standard buttons, which already
>> include "Yes"/"No"?
> Better yet, use a verb that expresses what will happen. Save is also standard, but otherwise you should set a text explicitly. Just Yes an No as buttons make for a horrible user experience.

Yes, you are right. And even more I switched to standard question method...

constQMessageBox::StandardButtonbtn=QMessageBox::question(this,

tr("Savingconfiguration..."),

tr("Wouldyouliketosaveconfiguration?"),

QMessageBox::StandardButtons(QMessageBox::Save|QMessageBox::No),

QMessageBox::Save);

if(btn==QMessageBox::Save)

saveConfiguration();


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170428/4ccdb20f/attachment.html>


More information about the Interest mailing list