QT/C++ 类型转换
“轻轻地我走了,正如我轻轻地来,我挥一挥衣袖,不带走一片云彩”------阿魔
1) int转为QString:
QString::number(int)
2) std::string转换成QString
string std_str ("abc");
QString q_str = QString::fromStdString(std_str);
3) QString转换成std::string
QString q_str("abc");string = q_str.toStdString();
4) std::string转换成char*
string std_str("abc");char *str = std_str.c_str(std_str);
5) std::string转换成int
https://blog.csdn.net/u010510020/article/details/73799996