Ash*_*hot 5 c++ qt compiler-errors
error: 'const class QString' has no member named 'toStdString'虽然QString有这个错误,但我收到了这个错误。(链接)。
编码
std::string Message::toStdString() const
{
return m_string.toStdString();
}
Run Code Online (Sandbox Code Playgroud)
直接从这里复制的答案:
QString qs;
// Either this if you use UTF-8 anywhere
std::string utf8_text = qs.toUtf8().constData();
// or this if you on Windows :-)
std::string current_locale_text = qs.toLocal8Bit().constData();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8897 次 |
| 最近记录: |