解决Qt Creator中文乱码的问题

方法1

使用QStringLiteral()包裹中文字符串

QString str1="中文测试!";
QString str2=QStringLiteral("中文测试!");

方法2

在这里插入图片描述

#if _MSC_VER >= 1600//MSVC2015>1899,MSVC_VER=14.0
#pragma execution_character_set("utf-8")
#endif

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/ea1d504f8a.html