1 //QString to wchar_t:
2 const wchar_t * encodedName = reinterpret_cast<const wchar_t *>(fileName.utf16());
3
4 //QString to char * (general case):
5 const char * tmp = str.toUtf8().constData();
6
7 //wchar_t* to QString
8 wchar_t szMsg[100] = {0};
9 _stprintf(szMsg,L"Connect [%s] failed!",ssid);
10 QString str1= QString::fromWCharArray(szMsg);
11
12 //char* to QString
13 QStirng str2(tr("Please try again later."));