//加载emoji字体
QString emojiFontFilePath = QApplication::applicationDirPath() + "Fonts/Apple Color Emoji.ttc";
QFile f(emojiFontFilePath);
qDebug() << "file exists:" << f.exists();
qDebug() << emojiFontFilePath;
auto addresult = QFontDatabase ::addApplicationFont(emojiFontFilePath);
qDebug() << "emoji font id" << addresult;
for (auto i : QFontDatabase::applicationFontFamilies(addresult).at(0))
{
qDebug() << "emoji family:" << i;
}
标签:qt,Color,emojiFontFilePath,字体,加载,Emoji
From: https://www.cnblogs.com/nocanstillbb/p/16750331.html