[Qt-interest] Other trouble with QPrintPreviewWidget

David Boddie david.boddie at nokia.com
Thu Dec 11 14:33:09 CET 2008


Marcelo Estanislau Geyer wrote:

> QFontMetrics fontMt(font);
> qDebug() << "Font pixel: " << fontMt.height(); // This values is 11px!
>  There is something wrong with that. It should be much higher because of
>  the resolution that I am using.

You need to pass the device to the QFontMetrics constructor, otherwise it
will just use the screen's resolution when calculating the font metrics.

Alternatively, you can pass the device when you construct the font.

David
-- 
David Boddie
Senior Technical Writer
Nokia, Qt Software



More information about the Qt-interest-old mailing list