QFont font("times", 24); QFontMetrics fm(font); int pixelsWide = fm.width("What's the width of this text?"); int pixelsHigh = fm.height();
The Above example is taken from http://qt-project.org/doc/qt-5.0/qtgui/qfontmetrics.html#details
This will help to paint the QString properly.
No comments:
Post a Comment