i have displayed a message by using QMessageBox and i have done all the translation related to my message but the Yes / No option cannot be translated. So how can it be done.
i have displayed a message by using QMessageBox and i have done all the translation related to my message but the Yes / No option cannot be translated. So how can it be done.
you can get access to dialog buttons using this method
http://doc.trolltech.com/4.4/qmessagebox.html#button
so, in you case you need to do
Qt Code:
... ...To copy to clipboard, switch view to plain text mode
i have added a message in message box box , but how the Ok can be changed
this code didn't help?
Qt Code:
... ...To copy to clipboard, switch view to plain text mode
yeah it wont work.
this code works fine
Qt Code:
msg.exec();To copy to clipboard, switch view to plain text mode
i did it but it said tr identifier not found.
use QObject::tr(...)
how i can use it with set text.
and also it shows "use of undefined type Qabstract button" with button means msgBox.button
see http://doc.trolltech.com/4.4/qobject.html#tr
include
Qt Code:
#include <QAbstractButton>To copy to clipboard, switch view to plain text mode
msg.button(QMessageBox::Ok)->setText(tr("My Ok label"));
here it shows tr identifier not found.
so here how can i use QObject.
Its not working , how the QMessageBOx button can be translated.
What is not working? What exactly did you do?
use QObejct::tr and Qt Linguist for translation.
i have to change all the buttons which are coming when we are using QMessageBox in the application . the text message is changed by using tr but the OK , yes, No buttons can not be changed. so how can i do this?
my mentor said u hav to create a class and derive it from QMessageBox and then remove that buttons and add ur own buttons. but how can i do that. means i have using it in one way which the other sir told me in the forum.
You don't have to do anything like that. Read my post again, it says exactly what you need to do and believe me it will work as Qt does it exactly the same when it translates the message box with a proper translator installed.
Bookmarks