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

QPrinter::pageRect ingores orientation for custom page sizes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • 4.8.x
    • 4.7.4
    • GUI: Printing
    • None

    Description

      If custom page size is selected for the printer, QPrinter::pageRect ignores page orientation and always return rect for portrait printing.

      qprintengine_win.cpp,

      QVariant QWin32PrintEngine::property(PrintEnginePropertyKey key) const

      take a look to the specified fragement:

          case PPK_PageRect:
              if (d->has_custom_paper_size) {
                  QRect rect(0, 0,
                             qRound(d->paper_size.width() * d->resolution / 72.0),
                             qRound(d->paper_size.height() * d->resolution / 72.0));
                  if (d->pageMarginsSet) {
                      rect = rect.adjusted(qRound(mmToInches(d->previousDialogMargins.left()/100.0) * d->resolution),
                                           qRound(mmToInches(d->previousDialogMargins.top()/100.0) * d->resolution),
                                           -qRound(mmToInches(d->previousDialogMargins.width()/100.0) * d->resolution),
                                           -qRound(mmToInches(d->previousDialogMargins.height()/100.0) * d->resolution));
                  }
                  value = rect;
              } else {
      

      It looks like there is no code for applying orientation at all.

      Attachments

        Issue Links

          Activity

            People

              johnlayt John Layt
              eugene_korobko eugene korobko
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: