标签:highlight ring const qstring str 问题 class cst bit
网上抄来的:
QString与string互转
str = qstr.toStdString(); qstr = QString::fromStdString(str);
由于编码方式导致的乱码可以如下解决:
qstring = QString::fromLocal8Bit(cstr.c_str()); cstr = string((const char *)qstring.toLocal8Bit());//或 cstr = qstring.toLocal8Bit().constData()
标签:highlight ring const qstring str 问题 class cst bit
原文地址:https://www.cnblogs.com/banlcer/p/13489113.html