PDA

View Full Version : How to convert unsigned short value[1] to QString?



Gokulnathvc
17th May 2012, 11:23
How to convert unsigned short value[1] to QString?

sonulohani
17th May 2012, 11:44
Hey bro,

use this--->

int main(.....){
unsigned short int ab=5;
QString str=QString::number(ab);
}

and your short will convert to string.

ChrisW67
17th May 2012, 11:55
Or, if the value in the unsigned short is supposed to be a wide character then:


QString str(QChar(value));

might do what you want. However, since the question is vague at best it is hard to know what you want.

I can't believe for a moment you actually have an array of one element.