版权声明:支持原创,转载请说明~ https://blog.csdn.net/luoyayun361/article/details/54934437
//设置本地字体,黑体简
- int fontId = QFontDatabase::addApplicationFont(QCoreApplication::applicationDirPath() + "/黑体简.TTC");
- qDebug() << "fontId = "<< fontId;
- QString msyh = QFontDatabase::applicationFontFamilies(fontId).at(0);
- qDebug() <<"msyh = " <<msyh;
- QFont font(msyh);
- QApplication::setFont(font);