PDA

View Full Version : Translate QPrintDialog



vcp
11th May 2009, 21:10
Hi All,

Is possible translate the text written inside buttons, Checkbox etc... inside the QPrintDialog.
It is possivel send me a simple example?

Thanks in advance.

febil
12th May 2009, 11:40
i think u can use findChild()

following code will add a new item to the combo box in the dialog. Like this u can access the button also.


QPrintDialog printDlg( PrinterName, this );
pComboBox = printDlg.findChild<QComboBox *>();
if( 0 != pComboBox )
{
QString NewItem = "NewItem";
pComboBox->addItem( NewItem );
}

vcp
12th May 2009, 18:26
Hi febil,

Thanks for you help, I'll use your example to do what I need.

Thanks

wysota
12th May 2009, 19:57
If you install a proper translator object with a message catalogue containing translations for the dialog, it should be used automatically. The default message catalogue for Qt proabably already contains those messages so it's enough to translate them for your language or install an already existing translation set in case there is one for your language.