1、wchar_t*转为QString
wchar_t* ch = L"hello world";
QString str1= QString::fromWCharArray(ch);
qDebug()<<"str1:"<<str1;
2、QString转为wchar_t*
QString fileName("test.txt");
const wchar_t *ch = reinterpret_cast<const wchar_t *>(fileName.utf16());
1、wchar_t*转为QString
wchar_t* ch = L"hello world";
QString str1= QString::fromWCharArray(ch);
qDebug()<<"str1:"<<str1;
2、QString转为wchar_t*
QString fileName("test.txt");
const wchar_t *ch = reinterpret_cast<const wchar_t *>(fileName.utf16());