Paint Symbol with drawText() method
-
That's almost certainly due to wrong encoding of your source files. Please have a look for
- CODECFORTR = UTF-8
in qmake .pro files - CODECFORSRC = UTF-8
in qmake .pro files - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
in your main method - QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
in your main method
- CODECFORTR = UTF-8
-
If you just get a rectangle in the place of the character you expected that hints to either the conversion being wrong (output the value of the QChar and compare that to the unicode tables to verify this is not the case) or that the font does not contain the requested symbol.
-
[quote author="Tobias Hunger" date="1331025740"]If you just get a rectangle in the place of the character you expected that hints to either the conversion being wrong (output the value of the QChar and compare that to the unicode tables to verify this is not the case) or that the font does not contain the requested symbol.[/quote]
then? how i have to do? cange the method to see if the code is not UTF8 but latin 1 o other?