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

QPrinter::setOutputFormat changes paper size when in landscape orientation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P4: Low
    • 4.8.x
    • 4.7.0
    • GUI: Printing
    • None
    • Mac OS X 10.6.7

    Description

      Whenever you switch the output format of a QPrinter on a Mac and the printer orientation is in landscape mode, the width and height of the paper size are switched.

      main.cpp
      #include <QtGui>
      int main(int argc, char ** argv) {
        QApplication app(argc, argv);
        QPrinter printer;
        printer.setOrientation(QPrinter::Landscape);
        printer.setPaperSize(QSizeF(8.5, 11), QPrinter::Inch);
        qDebug() << printer.orientation() << printer.paperSize(QPrinter::Inch);  // 1 QSizeF(11, 8.5) 
        printer.setOutputFormat(QPrinter::PdfFormat);
        qDebug() << printer.orientation() << printer.paperSize(QPrinter::Inch);  // 1 QSizeF(11, 8.5) 
        printer.setOutputFormat(QPrinter::NativeFormat);
        qDebug() << printer.orientation() << printer.paperSize(QPrinter::Inch);  // 1 QSizeF(8.5, 11) 
      }
      

      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
              dmateer Dave Mateer
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes