std::string to qstring 1

std::string to qstring

QString str = QString::fromUtf8(content.c_str());

Here is what the above code is Doing:
1. We create a QString object from the string content.
2. We create a QTextStream object from the QString object.
3. We read the QTextStream object into a QString object.
4. We convert the QString object into a std::string object.
5. We return the std::string object.

Similar Posts