Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
In QML what units does the Textmetrics width is been calculated?

Let me know on what units the TextMetrics width is display [pixel/point or some other ..] Below is the snippet of my code and output of the same.

TextMetrics 
{
   id:textMetrics
   text: ''
}

onPopupItemsChanged; {
var lowerCase = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'

console.log("Lower Case")
for(var k = 0; k < lowerCase.length; k++) {
   textMetrics.text = lowerCase[k];
   console.log(textMetrics.text, textMetrics.width)
}

}

Output:
qml: Lower Case
qml: a 7
qml: b 8
qml: c 7
qml: d 8
qml: e 8
qml: f 5
qml: g 8
qml: h 7
qml: i 3
qml: j 5
qml: k 7
qml: l 3
qml: m 11
qml: n 7
qml: o 9
qml: p 8
qml: q 8
qml: r 5
qml: s 7
qml: t 5
qml: u 7
qml: v 8
qml: w 12
qml: x 8
qml: y 8
qml: z 7

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

width() simply returns boundingRect().width() which is in pixels:

https://doc.qt.io/qt-5/qfontmetricsf.html#boundingRect

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!