头文件包含:#include <QTextCodec>

在QApplication app(argc,argv);之后加:

QTextCodec::setCodecForTr(QTextCodec::codecForName("GBK"));

显示中文时调用:

QObject::tr("中文")

例如:

QLabel hello(QObject::tr("你好世界"));

相关文章:

  • 2022-01-02
  • 2021-04-29
  • 2021-08-22
  • 2021-06-26
  • 2021-10-13
猜你喜欢
  • 2021-05-08
  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2021-09-13
相关资源
相似解决方案