[Qt-interest] Other trouble with QPrintPreviewWidget

Marcelo Estanislau Geyer estanisgeyer at hotmail.com
Thu Dec 11 14:18:54 CET 2008


Hi David and Friends,

I'm having another problem and believe that may be another bug. Still
using QPrinter: HighResolution to resolve the problems earlier. 
 I'm creating a report and use QFontMetrics::height to get the
information from the height of the font that I am using to use as the
distance between the rows of my report. But the information is
returned to 11px this code:



QFont font;
font.setFamily("Sans");
font.setPointSize(5);
painter.setFont(font);

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.
Thanks,

Marcelo E. Geyer
Brazil

> From: david.boddie at nokia.com
> Date: Wed, 10 Dec 2008 16:58:54 +0100
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] Trouble with QPrintPreviewWidget
> 
> David Boddie wrote:
> 
> > Just following up, it seems that the preview depends on the resolution of
> > the screen, which is counterintuitive given that you would want to paint
> > onto the QPrinter using the same commands that you use for the printed
> > output.
> > 
> > I'll file a bug report.
> 
> And following up again, your workaround to use QPrinter::HighResolution is
> the right thing to do here. The bug appears to be present when using
> QPrinter::ScreenResolution. For various reasons, it's preferable to use
> QPrinter::HighResolution, anyway, so I suggest you use that instead.
> 
> David
> -- 
> David Boddie
> Senior Technical Writer
> Nokia, Qt Software
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest

_________________________________________________________________
Instale a Barra de Ferramentas com Desktop Search e ganhe EMOTICONS para o Messenger! É GRÁTIS!
http://www.msn.com.br/emoticonpack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20081211/fd85d86e/attachment.html 


More information about the Qt-interest-old mailing list