To add to the other answers, QString fundamentally different from std::string because it is specifically designed to store a Unicode string. Although std::string may contain a Unicode string encoded in UTF-8, some platforms (such as Windows) do not support UTF-8.
For historical reasons, QString internally represents string data in UTF-16, but has conversion methods for outputting string data in other formats, including UTF-8.
When creating a Qt application, it is best to stick to QString , since all its APIs use Qt, and you do not have to deal with encoding / re-encoding from std::string or std::wstring , the later of which has different meanings on different platforms.
source share