QT可以设置文字属性,例如设置窗口名称,但有时会显示乱码,这时只需要在头文件加上一句代码 #pragma execution_character_set(“utf-8”) 再qmake一下,编译一下,就可以正常显示!