eric6/Tools/UIPreviewer.py

changeset 8298
83ddb87b3bc1
parent 8243
cc717c2ae956
equal deleted inserted replaced
8297:c1f9e30c6219 8298:83ddb87b3bc1
579 Private slot to the actual printing. 579 Private slot to the actual printing.
580 580
581 @param printer reference to the printer object (QPrinter) 581 @param printer reference to the printer object (QPrinter)
582 """ 582 """
583 p = QPainter(printer) 583 p = QPainter(printer)
584 marginX = (printer.pageRect().x() - printer.paperRect().x()) // 2 584 marginX = (
585 marginY = (printer.pageRect().y() - printer.paperRect().y()) // 2 585 printer.pageLayout().paintRectPixels(printer.resolution()).x() -
586 printer.pageLayout().fullRectPixels(printer.resolution()).x()
587 ) // 2
588 marginY = (
589 printer.pageLayout().paintRectPixels(printer.resolution()).y() -
590 printer.pageLayout().fullRectPixels(printer.resolution()).y()
591 ) // 2
586 592
587 # double the margin on bottom of page 593 # double the margin on bottom of page
588 if printer.orientation() == QPrinter.Orientation.Portrait: 594 if printer.orientation() == QPrinter.Orientation.Portrait:
589 width = printer.width() - marginX * 2 595 width = printer.width() - marginX * 2
590 height = printer.height() - marginY * 3 596 height = printer.height() - marginY * 3

eric ide

mercurial