QString str = tr("hello");
1、QString转化为LPSTR
(1)QString做为LPSTR类型的函数参数传递
(LPSTR)str.toLocal8Bit().data();
(2)直接赋值
LPSTR data = (LPSTR)"hello";
2、QString转化为LPTSTR
(1)QString做为LPTSTR类型的函数参数传递
(LPTSTR)str1.utf16();
(2)直接赋值
LPTSTR data = (LPTSTR)"hello";