Text implicit width
-
Dear All
I need to determine Text box width based on the text.
I could see difference in sizes when I use Text metrics w.r.t. implicitWidth.
For few of the cases textMetrics.width is not giving the actual width that is needed for the given text.But when I use implicitWidth i dont see any issue. Any thoughts on this?
Is it Ok to use implicitWidth ?Text {
id: txt
text: qsTr("This is Test sample")width: textMetrics.width //txt.implicitWidth height: 14 elide: Text.ElideRight font.pixelSize: 11 font.family:"Arial" color: "#2B2D2E" font.letterSpacing: 0 }
TextMetrics {
id: textMetrics
font: txt.font
text: txt.text
}Regards
Chandra