[Development] Development Digest, Vol 57, Issue 23

Steve Schilz sschilz at pasco.com
Tue Jun 7 17:57:09 CEST 2016

Hi Thomas, Thanks for taking a look.

I have submitted a change request, which is currently at +1 status (thanks Edward Wellborn)  https://codereview.qt-project.org/#/c/158402/, and after a few rounds we have this text:

    The units are determined by the underlying paint device. The size is
    measured in logical pixels when painting to the screen, and in points
    (1/72 inch) when painting to a printer.

I tried to add you as a reviewer, but didn’t find you in the system.   Feel free to add yourself as a reviewer, or comment there. 

Steve Schilz
PASCO scientific - think science

On 6/7/16, 7:04 AM, "Development on behalf of development-request at qt-project.org" <development-bounces+sschilz=pasco.com at qt-project.org on behalf of development-request at qt-project.org> wrote:
>Message: 4
>Date: Tue, 7 Jun 2016 10:26:27 +0200
>From: Thomas Krenn <thomas.krenn at kabsi.at>
>To: development at qt-project.org
>Subject: [Development] Documentation for
>	QPagedPrintDevice::setPageSize should specify a unit
>Message-ID: <57568533.1070701 at kabsi.at>
>Content-Type: text/plain; charset="utf-8"; Format="flowed"
>Steve Schilz requested on Wed, 4 May 2016:
>QPagedPrintDevice::setPageSize should specify a unit
>QTextDocument::setPageSize (http://doc.qt.io/qt-5/qtextdocument.html#pageSize-prop)
>Looking at the source code and the generated PDF's my conclusion is
>is that the numbers of the property pageSize dependent on the platform
>because all internal calculations of QTextDocument are done with: 'qt_defaultDpi'
>Notably on Windows (qt_defaultDpi = 96 dpi) the produced PDF is to small
>with a pageSize e.g.:
>fullRectPoints  595 / 842  (595,44) / (841,62)     (72 dpi / A4)
>and a PDF printer with:
>     QString pdfName("hello.pdf")
>     QPrinter printer(QPrinter::HighResolution);
>     printer.setOutputFormat(QPrinter::PdfFormat);
>     printer.setOutputFileName(pdfName);
>     printer.setResolution(1200);
>     QPageSize pageSizeA(QPageSize::A4);
>     printer.setPageSize(pageSizeA);
>// setting the printer margin to 0 (or full page mode) is important to avoid PDF page scaling.
>     QMarginsF margins(0, 0, 0, 0);
>     printer.setPageMargins(margins);
>Best regards
>Thomas Krenn

More information about the Development mailing list