Thanks a lot, I'll read it. Regards
Thanks a lot, I'll read it. Regards
No, that links didn't solve the problem. The problem is, that createLanguageMenu is different that, let's say, createFileMenu, and I am designing forms in designer, so I can't change createLanguageMenu without accessing ui_.h file code. And I'd like to know, how to do dynamic language switching when you were designing forms by designer, not manually. Regards
It's done in code for the reason that usually you don't want a static hard coded language menu (done in designer) but rather a dynamic menu loaded according to detected language files. This way new language files can be added later without recompiling the application.
J-P Nurmi
You can do this with actions created in designer. You still might want to instantiate a QActionGroup or QSignalMapper in code instead of creating separate slots for each action. Then just switch the language according to the action (it's up to you whether you use text, objectName, data, or something else).
However, I was talking about flexibility with adding new translations. If you create language actions in designer, you will have to add a new action and recompile the application if you later decide to add a new translation to your application.
J-P Nurmi
Bookmarks