Qt-interest Archive, May 2008
Custom widgets and retranslateUi
Message 1 in thread
Hi Everybody,
I have created several widgets and installed them in the designer via a plugin. I can then use them in forms. The UIC utility generates code to create the widgets in the forms and all this works very well.
The UIC also generates a routine for each form called retranslateUi. The assistant only mentions this routine in relation to Qt3 conversion. The list archives suggest that this routine has to be called manually for each open form after changing the language.
How do people handle this for custom widgets - especially if the custom widgets are not themselves created in the designer?
Thanks in advance!
Tony Rietwyk
--
[ signature omitted ]
Message 2 in thread
Hi,
> The UIC also generates a routine for each form called retranslateUi. The assistant only mentions this routine in relation to Qt3 conversion. The list archives suggest that this routine has to be called manually for each open form after changing the language.
There's also a thread related to Qt 4 in the archive:
http://lists.trolltech.com/qt-interest/2007-06/thread00157-0.html
> How do people handle this for custom widgets - especially if the custom widgets are not themselves created in the designer?
You'll have to define something similar to retranslateUi() for your own
widgets, and call it manually to change the application language dynamically.
As suggested in the above thread:
Perhaps you can read "17. Internationalization" Chapter,
"Dynamic Language Switching" Section in the C++ GUI
Programming with Qt 4.
The PDF for "C++ GUI Programming with Qt 3" can still be downloaded:
http://phptr.com/content/images/0131240722/downloads/blanchette_book.pdf
--
[ signature omitted ]