Why the QFontMetrics::boundingRect() return a wrong size rect?

647 Views Asked by At

I'm using Qt4.7. When I use QFontMetrics to render my text in some situation, I got a wrong width. My code is like this:

QFontMetrics fm(QApplication::font());
QRect rc = fm.boundingRect(str);

I found that fm.boundingRect(str) always return a fixed rect while the dpi changed.

0

There are 0 best solutions below