Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.7.4
-
None
-
Mac 10.6.8
Description
When you set a custom paper size on the Mac, a scene rendered to the printer only appears in a small portion of the page in the upper-left. The reason is that the default target rect is being set incorrectly within QGraphicsScene::render, obtaining a faulty value from QMacPrintEngine::metric().
main.cpp
#include <QtGui> int main(int argc, char **argv) { QApplication app(argc, argv); QGraphicsScene scene; scene.addRect(0., 0., 800., 600., QPen(), QBrush(Qt::BDiagPattern)); QGraphicsView view(&scene); view.show(); QPrinter printer(QPrinter::HighResolution); printer.setPaperSize(QSizeF(8.5, 11.), QPrinter::Inch); printer.setPageMargins(1., 1., 1., 1., QPrinter::Inch); QPrintDialog dialog(&printer, &view); if (dialog.exec() == QDialog::Accepted) { QPainter painter(&printer); scene.render(&painter); } return app.exec(); }
This is related to, but not the same as, QTBUG-18723. The fix is similar. I think I have it fixed, and will submit a patch for review after some more testing.
Attachments
Issue Links
- is required for
-
QTBUG-25380 QtPrintSupport - Page Layout Issues
- Open
-
QTBUG-25383 QtPrintSupport - macOS Issues
- Closed