You can use QFontMetrics class – see the width() method which can give you the width of a given QString.
QFont myFont(fontName, fontSize);;
QString str("I wonder how wide this is?");
QFontMetrics fm(myFont);
int width=fm.width(str);
You can use QFontMetrics class – see the width() method which can give you the width of a given QString.
QFont myFont(fontName, fontSize);;
QString str("I wonder how wide this is?");
QFontMetrics fm(myFont);
int width=fm.width(str);