Qt4中的
QTextCodec::setCodecForTr(QTextCodec::codecForName("System"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
在Qt5中已经不能用。
解决方法:
使用宏定义:#define tr QStringLiteral
QString s= tr("提示");
原文:http://www.cnblogs.com/charlie2015/p/4209085.html