Hi,
tr("My message translated"),
this);
//Set the translation text of the buttons. Here you need to have a QTranslator installed that will translate the "Yes" and "No" texts:
messageBox.
setButtonText(QMessageBox::Cancel,tr
("Cancel"));
QMessageBox messageBox(tr("Info"),
tr("My message translated"),
QMessageBox::Question,
QMessageBox::Yes | QMessageBox::Default,
QMessageBox::Cancel | QMessageBox::Escape, //This makes "Esc" key to Cancel the Dialog
QMessageBox::NoButton,
this);
//Set the translation text of the buttons. Here you need to have a QTranslator installed that will translate the "Yes" and "No" texts:
messageBox.setButtonText(QMessageBox::Yes,tr("Yes"));
messageBox.setButtonText(QMessageBox::Cancel,tr("Cancel"));
To copy to clipboard, switch view to plain text mode
Bookmarks