PDA

View Full Version : Display special symbols



ShaChris23
30th April 2007, 23:40
Can someone show me how to display special symbols characters using QLabel? Especially the degree symbol?

For example, I want to display latitude in terms of degree, minute, second like

Latitude: 70* 34' 30"

and replace the * with the actual degree symbol:

70, 34, 30 are 3 different double values

so in C++, it's kinda like:

double degree, minute, second
string = "Latitude: " + degree + "*" + minute + "'" + second """;
cout << string;

marcel
30th April 2007, 23:51
You can do this via QLabel::setText( QString ).
QString can be built from an Unicode array with QString::fromUtf16. All you need to do is pass the 2-byte Unicode character code of the character you want displayed. For °, you have 0x00b0.

Regards