QSting, QChar, char等的转换

1,QChar 转换char: char QChar::toLatin1();char QChar::toAscii();

2,Char转QChar: QChar(char ch);

3,QString 转char*:

QString str; char *ch; QByteArray ba=str.toLatin1();ch = ba.data();

4,char *转QString:

char *c_str = "hellow";QString str=QString(QLatin1String(c_str));

5,QString 转QChar*:

QString str = "hellow"; QChar *char = new QChar[10]; char = str.data();

6,QChar 转QString: QString(QChar ch);

 

7,QString转数字:QString::toxxx.

8,数字转QString: QString::number(), setNum

 

posted on 2019-04-15 17:05  yangjunhe  阅读(7009)  评论(0编辑  收藏  举报