如何在 Qt 中转换最简单的方法?
int recordSize = 1000;
TCHAR* qRecord = new TCHAR[recordSize];
//here I get data form other function
//here I try to display
qString() << QString::fromWCharArray(qRecord,recordSize);//gives many ????
printf("%s",qRecord); // this work perfectly
我尝试使用 wcstombs、formStdWString 和其他,但似乎没有任何效果。 感谢您的帮助
最佳答案
QString s= (LPSTR)qRecord;
工作。 谢谢
关于qt - 将 TCHAR* 转换为 QString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20327357/