1. 程式人生 > >QString與LPCWSTR 帶中文的相互轉換

QString與LPCWSTR 帶中文的相互轉換

這個問題困擾了我一週,記錄一下以免忘了!

QString wlpstr = QString::fromLocal8Bit("中國我愛你!");
std::wstring wlpstr = m_findStr.toStdWString();
LPCWSTR lpcwStr = wlpstr.c_str();
QString str = QString::fromStdWString(lpcwStr);