Show all fonts in QML
expecting the reader to know how to use listview and listmodel in QML
Component{
id: font_delegate
Text {
text: modelData
font.family: modelData
}
}
ListView{
id: listview
delegate: font_delegate
model: Qt.fontFamilies()
anchors.fill: parent
spacing: 10
highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
}
source:
http://doc.qt.digia.com/qt-5.2/qtquick-text-example.html
Comments
Post a Comment