文本操作防止中文乱码
int main
{
QTextCodec *codec = QTextCodex::codexForName("UTF-8");
QTextCodec::setCodeForLocale(codec);
QTextCodec::setCodeForCStrings(codec);
QTextCodec::setCodeForTr(codec);
QTextCodec::setCodeForCStrings(QTextCodec::codecForName("system"));
QTextCodec::setCodeForLocale(QTextCodec::codecForName("system"));
QTextCodec::setCodeForTr(QTextCodec::codecForName("system"));
QApplication a(argc,argv);
}