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

[Windows] QPageLayoutDialog landscape mode swaps width & height of page size

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.13.1
    • GUI: Printing
    • None
    • Windows 10
    • Windows

      When setting the orientation to landscape mode in the QPageLayoutDialog on Windows10, the width and height of the page size are swapped. The layout id changes f.e. to the"A4 rotated" format or "Custom" if not supported by the printer. This bug could not be reproduced on Linux or macOS. The portrait mode works fine and the QPrinter::orientation is set correctly.

       

      Reproducable with Qt's Font Sampler Example:

      I added some output to the MainWindow::printDocument function:

      void MainWindow::printDocument(QPrinter *printer)
      {
          QPageLayout layout = printer->pageLayout();
          qDebug() << "Orientation:" << layout.orientation();
          qDebug() << "Page Size:" << layout.pageSize();
          qDebug() << "Full Rect:" << layout.fullRect();
          qDebug() << endl;
      
          ...
      

      After starting the example program, selecting a font and then clicking File->Print Preview... in the menu bar, the default output is:

      Then open the page layout menu (left from the print button) and press OK with the orientation set to landscape mode ("Querformat" in this screenshot).

      Now the page width & height are swapped while the orientation is still the same. You can also see that the orientation buttons in the upper toolbar are still set to landscape (as they should).

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

            johnlayt John Layt
            tps T S
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes