客户反馈93的qt显示中文会乱码 解决方案:以下代码拷贝到main.cpp,并将文泉驿字库拷贝到应用的运行路径 #include <QDir> #include <QFontDatabase> //需要包含上面头文件 QDir dir(a.applicationDirPath()+"/", "*.ttf"); foreach (QFileInfo info, dir.entryInfoList()) { int id =QFontDatabase::addApplicationFont(info.absoluteFilePath()); QString family = QFontDatabase::applicationFontFamilies(id).at(0); QFont font(family); a.setFont(font); break; |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-22 11:26
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.