1、QString与int相互转换
QString qstr = QString::number(123);
int i = atoi(qstr.toStdString().c_str());
也可以这样:int i = atoi(qstr.ascii());
2、QString与string,即std::string
string s = qstr.toStdString();
QString qstr2 = QString::fromStdString(s);
欢迎光临 firemail (http://firemail.wang:8088/) | Powered by Discuz! X3 |