1.解决乱码问题
#include<QtGui>
#include<QTextCodec>int main(int argc, char* argv[])
{
QApplication app(argc ,argv);
QTextCodec::setCodecForTr(QTextCodec::codecForLocale());
QDialog* dd =new QDialog();
QLabel* label=new QLabel(dd);
label->setText(QString::fromUtf8("同一个世界,同一个梦想!"));
dd->show();
return app.exec();
}
只需两行红色代码即可。