translation - Qt: display dynamically composed non-English text on Labels or buttons -
i trying display dynamically generated hindi text on qpushbutton.
please have @ following code:
char nam[] = { 40, 9, 62, 9, 46, 9 }; qstring namestringinhindi(qstring::fromrawdata((qchar *)nam, 3)); qdebug() << namestringinhindi;
output: "नाम"
but if ui->pushbutton->settext(namestringinhindi) //some junk characters getting printed.
i have tried setting application font well.
qfontdatabase::addapplicationfont("/usr/share/fonts/lohit-devanagari/lohit-devanagari.ttf")
and qapplication::setfont(qfont("lohit devanagari",12));
but did not help.
could please me issue? thank time.
i don't know why code doesn't work, adding empty string string created raw data somehow fixes string. works in linux qt 5.0.1:
qstring namestringinhindi(qstring::fromrawdata((qchar*)nam, 3) + "");
Comments
Post a Comment