Hi,
28.04.2017 22:03, André Somers пишет:
Op 28 apr. 2017 om 20:34 heeft Konstantin Shegunov <kshegu...@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();
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest