QT 显示中文的三种方法

确保文件格式为UTF-8编码

QT 显示中文的三种方法

 

方法一
QString::fromLocal8Bit("你好中国")

方法二
QStringLiteral("你好中国")

方法三
在.cpp中加入

#pragma execution_character_set("utf-8")

相关文章:

  • 2022-01-02
  • 2022-12-23
  • 2021-06-26
  • 2021-08-20
  • 2021-11-28
  • 2021-12-12
猜你喜欢
  • 2022-12-23
  • 2021-06-17
  • 2021-10-15
  • 2021-11-01
  • 2022-12-23
  • 2022-01-05
  • 2021-09-13
相关资源
相似解决方案