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 |