# HG changeset patch # User Matti Hamalainen # Date 1505815289 -10800 # Node ID 9511e2f250be6c0e73364ec9824c28b2a1984185 # Parent 186d0717707f40612013daa5b20a84b16ca646c6 Force default page margins for printing, this fixes some problems under Windows. diff -r 186d0717707f -r 9511e2f250be src/printing.cpp --- a/src/printing.cpp Tue Sep 19 12:25:13 2017 +0300 +++ b/src/printing.cpp Tue Sep 19 13:01:29 2017 +0300 @@ -18,9 +18,10 @@ { // Create a printer object and force some basic settings QPrinter printer(QPrinter::HighResolution); + printer.setResolution(300); printer.setPageSize(QPageSize(QPageSize::A4)); + printer.setPageMargins(QMarginsF(0.25f, 0.5f, 0.25f, 0.5f), QPageLayout::Inch); printer.setColorMode(QPrinter::GrayScale); - printer.setResolution(300); // We need to get the page count here, and also need it again in // printDocument(), but there is no sane way to pass that there,