Hi,
I had this:
int r
= QMessageBox::question(this, tr
("Delete CD"), tr
("delete \"%1\" and all its tracks?") .arg(record.value(cd_idartista).toString()),
...
int r = QMessageBox::question(this, tr("Delete CD"), tr("delete \"%1\" and all its tracks?")
.arg(record.value(cd_idartista).toString()),
QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape);
if(r == QMessageBox::No)
...
To copy to clipboard, switch view to plain text mode
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:
trUtf8("Delete CD"),
trUtf8("Eliminar \"%1\" e todas as pistas?").arg(record.value(cd_titulo).toString()),
trUtf8("&Sim"),
trUtf8("&Não"),
1,
1 );
int result = QMessageBox::question(this,
trUtf8("Delete CD"),
trUtf8("Eliminar \"%1\" e todas as pistas?").arg(record.value(cd_titulo).toString()),
trUtf8("&Sim"),
trUtf8("&Não"),
QString::null,
1,
1 );
To copy to clipboard, switch view to plain text mode
... but it looks as this is considered to be obsolete(http://doc.trolltech.com/4.6/qmessagebox-obsolete.html).
Now i have:
msgBox.setText(trUtf8("Delete CD"));
msgBox.setInformativeText(record.value(cd_titulo).toString());
...
QMessageBox msgBox;
msgBox.setText(trUtf8("Delete CD"));
msgBox.setInformativeText(record.value(cd_titulo).toString());
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::No);
if(msgBox.exec() == QMessageBox::No)
...
To copy to clipboard, switch view to plain text mode
Now ... how do i change the Yes/No text by Sim/Não ?
Thanks
Bookmarks