3

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.

demonplus
  • 5,613
  • 12
  • 49
  • 68
  • It appears to be using the dpi of the primary screen regardless of which screen it's on. Every find a fix for this? – mrg95 Sep 02 '22 at 03:11

0 Answers0