Skip to content

Instantly share code, notes, and snippets.

@shenjing023
Last active December 15, 2017 01:43
Show Gist options
  • Select an option

  • Save shenjing023/195b7a314fab857a47a395975c37cb0e to your computer and use it in GitHub Desktop.

Select an option

Save shenjing023/195b7a314fab857a47a395975c37cb0e to your computer and use it in GitHub Desktop.
[QML添加第三方字体] #qml

在main.cpp中添加

QFontDatabase::addApplicationFont("xxx.ttf")

然后就可以在qml文件中使用font.family="xxx"来设置字体,这样比在qml文件中使用Fontloader更方便。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment