Momergil
19th May 2014, 21:25
Hello!
I want to display text characters in a QLabel, something like this:
ui->label->setText("Φ");
I'm not very familiar with special characters in Qt; every time till now I've being using ASCII hexa characters to set special chars, but now it would seem I'll have to use UTF-8. The problem is that I'm really not familiar with text codes and encodings and the like (something that is in my TOLEARN list of Qt) and I need this quickly :)
Doing some research, I found this thread: http://www.qtcentre.org/threads/8108-greek-symbols (and also http://www.qtcentre.org/threads/3467-unable-to-have-greek-characters-appear-in-a-text-Label), but nothing of the provided methods worked for me :(
I'ld also like to add that it should be "quick insertions" of special characters (greek text), so I'ld like to avoid whole-code changes such as by using method as QTextCodec::setCodecForCStrings() or anything of the like that has a more "global scope".
Thanks for any help,
Momergil
Details: using Qt 4.8 and Linux
I want to display text characters in a QLabel, something like this:
ui->label->setText("Φ");
I'm not very familiar with special characters in Qt; every time till now I've being using ASCII hexa characters to set special chars, but now it would seem I'll have to use UTF-8. The problem is that I'm really not familiar with text codes and encodings and the like (something that is in my TOLEARN list of Qt) and I need this quickly :)
Doing some research, I found this thread: http://www.qtcentre.org/threads/8108-greek-symbols (and also http://www.qtcentre.org/threads/3467-unable-to-have-greek-characters-appear-in-a-text-Label), but nothing of the provided methods worked for me :(
I'ld also like to add that it should be "quick insertions" of special characters (greek text), so I'ld like to avoid whole-code changes such as by using method as QTextCodec::setCodecForCStrings() or anything of the like that has a more "global scope".
Thanks for any help,
Momergil
Details: using Qt 4.8 and Linux