在main.cpp中添加 QFontDatabase::addApplicationFont("xxx.ttf") 然后就可以在qml文件中使用font.family="xxx"来设置字体,这样比在qml文件中使用Fontloader更方便。