Use the new non-obsoleted functions for getting the paper details

This fixes a problem with the margins not being correctly respected as the
functions introduced previously would set a different property to what was
being queried in this case.

Change-Id: I3458c8e46239276a296d17aa80da7330c85fcf0a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Andy Shaw 2015-04-17 08:04:04 +02:00 committed by Andy Shaw
parent e96ad10fd8
commit ab156fcedd

View File

@ -335,8 +335,8 @@ void QPrintPreviewWidgetPrivate::populateScene()
pages.clear();
int numPages = pictures.count();
QSize paperSize = printer->paperRect().size();
QRect pageRect = printer->pageRect();
QSize paperSize = printer->pageLayout().fullRectPixels(printer->resolution()).size();
QRect pageRect = printer->pageLayout().paintRectPixels(printer->resolution());
for (int i = 0; i < numPages; i++) {
PageItem* item = new PageItem(i+1, pictures.at(i), paperSize, pageRect);