[Uml-devel] [Patch] printer border problem
Andi Fischer
andi.fischer at hispeed.ch
Mon Nov 28 21:15:51 UTC 2011
Am 28.11.2011 20:43, schrieb Ralf Habacker:
> Hi,
> in UMLView::print(QPrinter *pPrinter, QPainter & pPainter) there is a
> wrong border calculation, which is fixed by the appended patch.
> Some details: In the above mentioned method the borders are
> calulcated from current QPrinters settings
> ...
> > uint left, right, top, bottom;
> QRect paper = pPrinter->paperRect();
> QRect page = pPrinter->pageRect();
> > top = paper.top() - page.top();
> > left = paper.left() - page.left();
> bottom = paper.bottom() - page.bottom();
> right = paper.right() - page.right();
>
> QPrinters doc says about QRect
> <http://doc.qt.nokia.com/4.7-snapshot/qrect.html> QPrinter::paperRect
> () const
>
> "Returns the paper's rectangle; this is usually larger than the
> pageRect <http://doc.qt.nokia.com/4.7-snapshot/qprinter.html#pageRect>()."
>
> this means that in the above mentioned line
> top = paper.top() - page.top();
>
> top will be a very high positive value (tested on windows with msvc)
> if paper.top() is smaller than page.top() which is usual the default.
>
> If there are no objectives, i would commit this patch.
>
> Regards
> Ralf
Please, commit this patch.
Regards
Andi
More information about the umbrello-devel
mailing list