QT中三种数据类型之间的转换:
QString
qtStr;
std::string stdStr;
char*
chStr;
则有:
(1)
qtStr = stdStr.c_str();
(2)
stdStr = qtStr.local8Bit(); 或者stdStr=qtStr.toStdString;
(3)
chStr=stdStr.c_str();
chStr=(const char*)qtStr.local8Bit();
chStr=(char*)stdStr;
(4)
int
转 QString
int a=10;
QString b;
b=QString::number(a)