[Interest] QML solution for fitting text?

Jason H jhihn at gmx.com
Tue Nov 17 19:32:16 CET 2015


I want to fit text into a rectangle, but dynamically size the text like scaling an image:
Rectangle {
width: // some with
width: // some height
Text { text: "Hello World"; anchors.fill: parent; font.pixelSize: ???<Dynamic> }
}

In the old QWidget days, I'd use QFontMetrics to figure out what size would fit. Has this been solved for QML? 



More information about the Interest mailing list