Question about QMessageBox obsolete members
Hi!
This is my first post in this comunity. I am beginning with Qt (porting my .Net Framework application) and I have a question. The official documentation marks some QMessageBox functions/methods as obsolete and I would like to know why. I am particulary talking about critical(), information(), question() and warning(). Do they use the obsolete function setButtonText()? I am interested in changing the texts of the buttons too, but I realized that I can do that using the setText() method of the QAbstractButton pointer that I get with messageBox.button().
Greetings and thanks!
7 replies
Where did you see that those functions are obsolete? Also, if you want to use custom message boxes you should just use the QMessageBox class and not its static member functions. Have a look into the documentation here [doc.qt.nokia.com] to see how that is done.
I saw it here [doc.qt.nokia.com] .
I know that I should use the class in order to customize it at maximum, but I would like to know why those functions are obsolete so I can write my own function without the same errors.
Greetings and thanks!
Just another question (should I open another topic?).
How can I translate the “Show Details” and “Hide Details” button of a QMessageBox? Yesterday I found a post (in another forum I think) that modified the text when the button was clicked, but I don’t think this is very good. How can I localizate Qt’s texts?
Greetings and thanks again!
EDIT:
I just realized that I can install a qt translator with this:
qtTranslator.load(“qt_” + QLocale::system().name(),
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
And Spanish is included in the official package, so I don’t think I have to translate it manually.
Thanks!
I also used this solution… tnxs to everyone! The translations are great!!!
Just another question (should I open another topic?).How can I translate the “Show Details” and “Hide Details” button of a QMessageBox? Yesterday I found a post (in another forum I think) that modified the text when the button was clicked, but I don’t think this is very good. How can I localizate Qt’s texts?
Greetings and thanks again!
EDIT:
I just realized that I can install a qt translator with this: qtTranslator.load(“qt_” + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
And Spanish is included in the official package, so I don’t think I have to translate it manually.Thanks!
You must log in to post a reply. Not a member yet? Register here!



