How to change string into QString?

前端 未结 7 781
一向
一向 2020-11-28 03:36

What is the most basic way to do it?

7条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 04:26

    std::string s = "Sambuca";
    QString q = s.c_str();
    

    Warning: This won't work if the std::string contains \0s.

提交回复
热议问题