将以下代码放在main里面最开始的地方
//解决中文乱码的问题QTextCodec *codc = QTextCodec::codecForName("GB2312");
QTextCodec::setCodecForCStrings(codc);QTextCodec::setCodecForLocale(codc);QTextCodec::setCodecForTr(codc);