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

QPrinter::setPaperSize(PaperSize) fails on Mac with non-metric paper

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • 4.8.1
    • 4.7.4
    • GUI: Printing
    • None
    • Mac 10.6.8
    • macOS

    Description

      If you set the paper size to a non-metric paper (i.e. US Letter), QPrinter::setPaperSize silently fails.

      main.cpp
      #include <QtGui>
      
      int main(int argc, char ** argv) {
        QApplication app(argc, argv);
      
        QPrinter printer;
      
        printer.setPaperSize(QPrinter::A4);
        qDebug() << printer.paperSize() << printer.paperSize(QPrinter::Millimeter);
      
        printer.setPaperSize(QPrinter::A5);
        qDebug() << printer.paperSize() << printer.paperSize(QPrinter::Millimeter);
      
        printer.setPaperSize(QPrinter::Letter);  // Absolutely nothing happens
        qDebug() << printer.paperSize() << printer.paperSize(QPrinter::Millimeter);
      
        return app.exec();
      }
      

      I have confirmed that the printer supports US Letter paper in the print dialog.

      Attachments

        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:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes