Dynamic Widget Translation in QTabWidget
-
Hi,
My application consists of the QTabWidget system in the main window. I implemented a language change in my application. When it calls in mainwindow:
ui->retranslateUi(this);only QMainWindow elements are translated. Unfortunately, the QWidgets in QTabWidget are not translated. How could he translate them?
-
Hi
Do you construct the tabs from code? -
Hi,
My application consists of the QTabWidget system in the main window. I implemented a language change in my application. When it calls in mainwindow:
ui->retranslateUi(this);only QMainWindow elements are translated. Unfortunately, the QWidgets in QTabWidget are not translated. How could he translate them?
@Creatorczyk Like @mrjj's question suggests only designer elements are translated (to be precise - those from UI file that qmake knows of when generates ui header file). My solution to dynamically (in code) created actions/elements is to add tr() calls to changeEvent(). Works every time.