Search code examples
c++qtmultilingualqevent

Qt LanguageChange event - find out new language


When I have changeEvent(QEvent* event) with receive type event->type() == QEvent::LanguageChange, how can I get information about what the new language is in my app?


Solution

  • Qt don't have any object to represent application langugae. So you should implement it yorself.

    Usually changeEvent(QEvent* event) with type QEvent::LanguageChange was caused by installTranslator(QTranslator*) so you should know witch langugae you loaded to translator and store it locally.