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

Printing to native printer doesn't work on Mac OS X

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.1.0 Beta 1, 5.1.0 RC1
    • Fix Version/s: 5.1.0
    • Labels:
      None
    • Environment:
      Tested on Mac OS X 10.8.4 (iMac8,1)
    • Platform/s:
      macOS

      Description

      The printing seems to be totally broken on Mac OS X when printing to native printer. Here is a simple example:

      QTextDocument *d = new QTextDocument();
      QTextCursor cursor = QTextCursor(d);
      cursor.insertText("TEST");
      
      QPrinter *printer = new QPrinter(QPrinter::HighResolution);
      printer->setOutputFormat(QPrinter::NativeFormat);
      
      QPrintDialog printDialog(printer, this);
      printDialog.setOption(QAbstractPrintDialog::PrintShowPageSize,true);
      if (printDialog.exec() == QDialog::Accepted) {
         d->print(printer);
      }
      

      This shows print dialog, but nothing prints when dialog is accepted. Instead it gives the following message to application output dialog:

      QPainter::begin(): Returned false
      

      There is no problem when using Qt 4.8.4 on Mac.

      This works on Windows with Qt 5.1. It works also on Mac OS X with Qt 5.1 when printing to pdf file (setOutputFormat is PdfFormat).

        Attachments

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

          Activity

            People

            Assignee:
            liaqi Liang Qi
            Reporter:
            jimcad J Matilainen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes