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

"QPdfWriter" created by "QIODevice" can't change page size

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 5.9.1
    • GUI: Printing
    • None

    Description

      "QPdfWriter" sets correct page size when created by file name,  while it doesn't init  "QPdfPagedPaintDevicePrivate" when created by "QIODevice".

       

      QPdfWriter::QPdfWriter(const QString &filename)
          : QObject(*new QPdfWriterPrivate),
            QPagedPaintDevice(new QPdfPagedPaintDevicePrivate(d_func()))
      {
          Q_D(QPdfWriter);
      
          d->engine->setOutputFilename(filename);
      
          // Set QPagedPaintDevice layout to match the current paint engine layout
          devicePageLayout() = d->engine->pageLayout();
      }

       

      QPdfWriter::QPdfWriter(QIODevice *device)
          : QObject(*new QPdfWriterPrivate)
      {
          Q_D(QPdfWriter);
      
          d->engine->d_func()->outDevice = device;
      
          // Set QPagedPaintDevice layout to match the current paint engine layout
          devicePageLayout() = d->engine->pageLayout();
      }

      Attachments

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

        Activity

          People

            johnlayt John Layt
            piggestbaby lei chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes