Usage of Material Icon font within QtQuick/QML applications
- Add
fonts/MaterialIcons-Regular.ttf
to your project - Add
MaterialDesign.js
to your project and import file to use icon names
import "MaterialDesign.js" as MD
- Load font using Fontloader:
FontLoader {
id: iconFont
source: "../fonts/MaterialIcons-Regular.ttf"
}
- Use loaded font in Text element and set text by identifier (read from
MaterialDesign.js
)
Text {
font.family: iconFont.name
font.pixelSize: 48
text: MD.icons.beach_access
}