std::string cstr;
QString qstring;
//****从std::string 到QString
qstring = QString(QString::fromLocal8Bit(cstr.c_str()));
//****从QString 到 std::string
cstr = string((const char *)qstring.toLocal8Bit());
本文共 250 字,大约阅读时间需要 1 分钟。
std::string cstr;
QString qstring;
//****从std::string 到QString
qstring = QString(QString::fromLocal8Bit(cstr.c_str()));
//****从QString 到 std::string
cstr = string((const char *)qstring.toLocal8Bit());
转载于:https://www.cnblogs.com/hermit/p/3783422.html