No.1 A way convert std::string to QString
There's a QString function called fromUtf8 that takes a const char*:
std::string content="test";
QString str = QString::fromUtf8(content.c_str());
No.2 A way convert QString to std::string
QString content("test");
std::string str=content.toStdString();