string to qstring c++ code example Example: std::string to qstring QString str = QString::fromUtf8(content.c_str());