there is a function that returns a string, and its result must be entered into a QListWidget which takes as input QSringList. on the usual operator = between the string and QString the compiler swears

    1 answer 1

    To convert from std::string to QString , Qt has a static function QString :: fromStdString . And there is also a QString::fromStdWString() function paired to it.

    • it is worth mentioning that QString::fromStdString() expects std::string in utf-8. If the encoding is different (including Latin-1), then it is better to use various conversion options from char * . - Fat-Zer