QMessageBox - Text in the buttons
Hi,
I had this:
Code:
int r
= QMessageBox::question(this, tr
("Delete CD"), tr
("delete \"%1\" and all its tracks?") .arg(record.value(cd_idartista).toString()),
...
The problem is that i get a "Yes" and "No" text in the Buttons, when i wanted "Sim" and "Não".
Then i tried this:
Code:
trUtf8("Delete CD"),
trUtf8("Eliminar \"%1\" e todas as pistas?").arg(record.value(cd_titulo).toString()),
trUtf8("&Sim"),
trUtf8("&Não"),
1,
1 );
... but it looks as this is considered to be obsolete(http://doc.trolltech.com/4.6/qmessagebox-obsolete.html).
Now i have:
Code:
msgBox.setText(trUtf8("Delete CD"));
msgBox.setInformativeText(record.value(cd_titulo).toString());
...
Now ... how do i change the Yes/No text by Sim/Não ?
Thanks
Re: QMessageBox - Text in the buttons
It was easy after all ...
Code:
msgBox.setText(trUtf8("Eliminar CD"));
msgBox.setInformativeText(record.value(cd_titulo).toString());
msgBox.exec();
if(msgBox.clickedButton() == myNoButton)
{
db.rollback();
return;
}
...
Re: QMessageBox - Text in the buttons
There's also one good way:
Code:
trUtf8("Eliminar CD"),
record.value(cd_titulo).toString(),
db.rollback();
return;
}
Re: QMessageBox - Text in the buttons
Code:
qtTrans.load("qt_pt.qm");
app.installTranslator(&qtTrans);
// ...
int r
= QMessageBox::question(this, tr
("Delete CD"), tr
("delete \"%1\" and all its tracks?") .arg(record.value(cd_idartista).toString()),
Re: QMessageBox - Text in the buttons
Any idea on how to access the 'Show Details..." button of a QMessageBox and add custom text in place of the "Show Details..." and "Hide Details..." texts?