PDA

View Full Version : Qt Linguist Some dialog boxes do not get translated



Windsoarer
21st December 2010, 05:12
Hi all,

Something strange is occurring in the latest releases of my project: when displaying the dialog boxes, some show up translated and some do not. There doesn't appear to be any logic. All the translations in the .ts files seem good - I've checked them in the text editor. There are no error messages during the lrelease command, nor at run time.
All classes inherit the Q_OBJECT macro.
The same behaviour occurs in linux and windows.

Any suggestions ???

Thanks,

Andre

Lykurg
21st December 2010, 07:11
Do you talk about self generated dialogs or about the Qt standard dialogs? For the later you have to include also the Qt specific qm file beside yours.

Windsoarer
14th May 2011, 11:19
Not it's my personal classes which are not translated. I finally understood which get translated and which do not, but still havn't found the fix.
Those which get translated are the dialog instances declared as member variables of a class.
Those which do not are ths which are constructed on the heap



void MyClass::MyFunction()
{

}


Added after 5 minutes:

Not it's my personal classes which are not translated. I finally understood which get translated and which do not, but still havn't found the fix.
Those which get translated are the dialog instances declared as member variables of a class.


void MyClass::MyFunction()
{
m_dlg;//declared as a member variable
m_dlg.exec(); //shows up translated
}


Those which do not are ths which are constructed on the heap


void MyClass::MyFunction()
{
MyDialog dlg;
dlg.exec(); //shows up not translated
}


Any ideas ? Been stuck with this for several months now :mad: