目录

qt5中使用中文报错error-C2001-常量中有换行符

目录

qt5中使用中文报错error: C2001: 常量中有换行符

1.qt5中使用中文报错error: C2001: 常量中有换行符

如这条代码:

 this->ui->pbtn_open_card->setText("关闭卡");

运行时报错,提示常量中有换行符

2.工具->选项->文本编辑,选择下图

https://i-blog.csdnimg.cn/direct/600231619992477cbb2cd112df5f807f.jpeg

3.重新按utf-8加载编码

https://i-blog.csdnimg.cn/direct/126522df21af4b48acef2f2d20989278.jpeg

4.文件开头添加

#pragma execution_character_set("utf-8")