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

QPrinter::setOutputFormat changes paper size when in landscape orientation

XMLWordPrintable

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

      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) 
      }
      

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

            johnlayt John Layt
            dmateer Dave Mateer
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes