QStringWchar2QString(wchar_t*buf) { returnQString::fromWCharArray(buf); } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. demo: wchar_tpath[1024]={0}; GetModuleFileName(NULL,path,1024); qDebug()<<Wchar2QString(path); wchar_t*path2; path2=QString2Wchar("hello xiaohai"); wcout<<path2...
你没有正确地使用它。您应该在要转换的QString上调用toWCharArray,并向其传递一个指向已分配数组的第...
QStringWchar2QString(wchar_t*buf) { returnQString::fromWCharArray(buf); } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. demo: wchar_tpath[1024]={0}; GetModuleFileName(NULL,path,1024); qDebug()<<Wchar2QString(path); wchar_t*path2; path2=QString2Wchar("hello xiaohai"); wcout<<path2...