Get the Witdth of a string in Pixels
-
Hello dear friends :)
Anybody knows how to get the width of a string in pixels ? I know we have to use QFontMetrics but I don't know how. I would be grateful if somebody can help me.
Thanks
-
Something like
@
QFont font = someFontWeWantToUse;
QFontMetrics metrics(font);
qreal textWidth = metrics.width(myText);@ -
thank you for having answered so quickly. :)
In fact it was easy ^^
have a good day!