- 获取Qt支持的所有字体:
QFontDatabase database;
for (QString family : database.families()) {
qDebug() << "Family:" << family;
}
- 获取Qt支持的所有中文字体:
for (QString chineseFamily : database.families(QFontDatabase::SimplifiedChinese)) {
qDebug() << "Chinese Family:" << chineseFamily;
}