主要是cpp里面有中文导致。解决方法:
(1)用Notepad++打开cpp文件
(2)打开菜单栏中[编码]项
(3)设置选择[转为UTF-8-BOM编码]
(4)保存。
string str = "中文";
pLabel->wrapData(QString::fromLocal8Bit(str.c_str()));
主要是cpp里面有中文导致。解决方法:
(1)用Notepad++打开cpp文件
(2)打开菜单栏中[编码]项
(3)设置选择[转为UTF-8-BOM编码]
(4)保存。
string str = "中文";
pLabel->wrapData(QString::fromLocal8Bit(str.c_str()));