#include <QtGui/QApplication>
#include <QPushButton>
#include <QTextCodec>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//设置编码为UTF-8,与文件编码保持一致
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
QTextCodec::setCodecForLocale(codec);
QTextCodec::setCodecForCStrings(codec);
QTextCodec::setCodecForTr(codec);
// MainWindow w;
// w.show();
QPushButton button("确定");
button.show();
return a.exec();
}
QT中文乱码问题
最新推荐文章于 2020-12-07 18:40:21 发布