You can also set the Text encoding on the application level and then you have to use tr() tags for every string that you are using.
Check the class QTextCodec
http://doc.trolltech.com/4.1/qtextcodec.html
int main( int argc, char ** argv )
{
QTextCodec::setCodecForTr(utfCodec
);
// setting the utf-8 codec for the tr() tags
FormMain w; // the main window
w.show();
return a.exec();
}
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
QTextCodec *utfCodec = QTextCodec::codecForName("UTF-8"); //creating new utf-8 codec
QTextCodec::setCodecForTr(utfCodec); // setting the utf-8 codec for the tr() tags
FormMain w; // the main window
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Before creating the main window create the utf-8 (or the one you need) codec and then set that codec to be used for the tr() tags.
Then in the files all the strings that should be shown should be passed trough the tr() tag.
tr("Не можам да ја пронајдам конфигурациската датотека за боите на шемите:\n %1").arg(Path), tr("Во ред"));
QMessageBox::critical( 0, tr("КМ Визуелизација") ,
tr("Не можам да ја пронајдам конфигурациската датотека за боите на шемите:\n %1").arg(Path), tr("Во ред"));
To copy to clipboard, switch view to plain text mode
The cirillyc letters are shown good
GREETZ, chombium
Bookmarks