Changing language in Qt at runtime

Hi, I have a Qt application and several plugins are connected to the application.

I want to change the language of the program at runtime, but I do not know how to do it.

I know that I can do this by calling this code:

ui.retranslateUi(this);

but since there are many plugins and many widgets on these plugins, it is difficult to write this code because the ui member is private in widgets. I do not want to write code for each class of widgets.

Do you know the best way to upload new translation files?

+3
source share
2 answers

remove QTranslator, , install . Qt LocaleChange , . .

+2

QEvent::LocaleChange , .

+1

Source: https://habr.com/ru/post/1753171/


All Articles