David Burson
David Burson

Reputation: 3197

how to calculate qfont pixel size from point size

How do I convert my font on a QGraphicsObject from point size to pixel size? I need to do this so the fonts will look right when I print my QGraphicsScene using QGraphicsScene::render().

Upvotes: 7

Views: 14879

Answers (1)

Kamil Klimek
Kamil Klimek

Reputation: 13130

Probably class QFontMetrics will do the job. Just create your desired QFont, set It's point size. Then create QFontMetrics object on your QFont.

Upvotes: 10

Related Questions