一杯清酒邀明月
天下本无事,庸人扰之而烦耳。
 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.")); 

 

posted on 2022-08-16 11:07  一杯清酒邀明月  阅读(527)  评论(0编辑  收藏  举报