Reputation: 293
I'm writing a multi-language program with the Qt framework. I want to change the language at runtime. I wrote the code below in a slot but it does not work.
QTranslator translator;
translator.load("arrowpad_tr");
qApp->installTranslator(&translator);
Upvotes: 2
Views: 2344
Reputation: 20028
Installing a translator only means that the specific translator becomes available. This is signaled by a LanguageChange event for the QCoreApplication. What you will still have to call is retranslateUi();
which will take care of the actual translation for Qt Designer widgets. For custom widgets you will have to create something similar based on the event.
Upvotes: 3