Qt 中 QString::toStdString转std::string崩溃
从websocket接收QString值,直接用QString::toStdString转成std::string会导致程序崩溃,如下图
解决办法:
使用 std::string str = std::string((const char *)msg.toLocal8Bit()); 进行转换
本文来自博客园,作者:一夜梦想,转载请注明原文链接:https://www.cnblogs.com/caiyingyong/p/13969951.html