Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35941

QPrinter returns incorrect QRect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.2.0
    • GUI: Printing
    • None
    • Mingw-w64

    Description

      When running the following program

      #include <QApplication>
      #include <QPainter>
      #include <QPrinter>
      #include <QPrintDialog>
      #include <QDebug>
      int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);
      QPrinter printer(QPrinter::HighResolution);
      printer.setPageMargins(.25, .25, .25, .25, QPrinter::Inch);
      QPrintDialog printDialog (&printer);
      if (printDialog.exec() == QDialog::Accepted)

      { qDebug() << "paperName" << printer.paperName(); qDebug() << "paperRect" << printer.paperRect(); qDebug() << "Resolution" << printer.resolution(); qDebug() << "pageRect" << printer.pageRect(); qDebug() << "pageSizeMM" << printer.pageSizeMM(); qDebug() << "pageSize" << printer.pageSize(); }

      }

      The output is:

      paperName "Letter"
      paperRect QRect(0,0 -8x-8)
      Resolution 600
      pageRect QRect(150,150 -308x-308)
      pageSizeMM QSizeF(210, 297)
      pageSize 30

      the QRects have negative sizes.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              johnlayt John Layt
              ant32 Philip A Reimer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes