PDA

View Full Version : adding special symbol unicode to qstring



wagmare
31st May 2016, 10:33
hi freinds/Experts,

I am adding special symbols to QString using


uint32_t val = 0x221A; //Roots
QString symbolText = QChar(val);
widget->setText(symbolText);

but for some range i not able to add those special characters

ex: 0x22F6 to 0x22FB , 0x2A0B to 0x2A1C.
these special mathematical symbols i have to add into my widget text.
for these ranges the output is always a empty box.

is it a problem with 32 bit char
QString is not supporting it
the way i implemented is wrong.

please help me.

ChrisW67
31st May 2016, 22:04
If you mean you see a character in the widget but it looks like a box instead of "SQUARE ROOT" (http://www.fileformat.info/info/unicode/char/221a/index.htm) then it is likely that the font you are using does not contain a glyph for that Unicode code point. This replacment symbol is often, but not always, the "WHITE SQUARE" glyph (http://www.fileformat.info/info/unicode/char/25a1/index.htm)

wagmare
1st June 2016, 06:03
thanks chris . your answer is right. i have to give options to select font also.