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

Mac supportedPaperSizes() returns duplicate and invalid values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.2.0 RC1
    • GUI: Printing
    • None
    • macOS

    Description

      The Mac supportedPaperSizes() and supportedSizesWithNames() methods do not filter the results returned from the native Mac api. As a result duplicated paper sizes for Borderless are included, as are the many Custom paper sizes that Qt does not yet support. For example, here is the result from the simulated test printer that I want to use in the test harness:

      QDEBUG : paper size = 252 x 360  =  QSizeF(88.9, 127)  =  "3.5 x 5" 
      QDEBUG : paper size = 252 x 360  =  QSizeF(88.9, 127)  =  "3.5 x 5 Borderless" 
      QDEBUG : paper size = 216 x 360  =  QSizeF(76.2, 127)  =  "3 x 5" 
      QDEBUG : paper size = 216 x 360  =  QSizeF(76.2, 127)  =  "3 x 5 Borderless" 
      QDEBUG : paper size = 288 x 432  =  QSizeF(101.6, 152.4)  =  "4 x 6" 
      QDEBUG : paper size = 288 x 432  =  QSizeF(101.6, 152.4)  =  "4 x 6 Borderless" 
      QDEBUG : paper size = 360 x 504  =  QSizeF(127, 177.8)  =  "5 x 7" 
      QDEBUG : paper size = 360 x 504  =  QSizeF(127, 177.8)  =  "5 x 7 Borderless" 
      QDEBUG : paper size = 576 x 720  =  QSizeF(203.2, 254)  =  "8 x 10" 
      QDEBUG : paper size = 576 x 720  =  QSizeF(203.2, 254)  =  "8 x 10 Borderless" 
      QDEBUG : paper size = 595.276 x 841.89  =  QSizeF(210, 297)  =  "A4" 
      QDEBUG : paper size = 595.276 x 841.89  =  QSizeF(210, 297)  =  "A4 Borderless" 
      QDEBUG : paper size = 419.528 x 595.276  =  QSizeF(148, 210)  =  "A5" 
      QDEBUG : paper size = 419.528 x 595.276  =  QSizeF(148, 210)  =  "A5 Borderless" 
      QDEBUG : paper size = 297.638 x 419.528  =  QSizeF(105, 148)  =  "A6" 
      QDEBUG : paper size = 297.638 x 419.528  =  QSizeF(105, 148)  =  "A6 Borderless" 
      QDEBUG : paper size = 296.986 x 684  =  QSizeF(104.77, 241.3)  =  "Envelope #10" 
      QDEBUG : paper size = 296.986 x 684  =  QSizeF(104.77, 241.3)  =  "Envelope #10 Borderless" 
      QDEBUG : paper size = 323.15 x 459.213  =  QSizeF(114, 162)  =  "Envelope C6" 
      QDEBUG : paper size = 323.15 x 459.213  =  QSizeF(114, 162)  =  "Envelope C6 Borderless" 
      QDEBUG : paper size = 340.158 x 666.142  =  QSizeF(120, 235)  =  "Envelope Choukei 3" 
      QDEBUG : paper size = 340.158 x 666.142  =  QSizeF(120, 235)  =  "Envelope Choukei 3 Borderless" 
      QDEBUG : paper size = 255.118 x 581.102  =  QSizeF(90, 205)  =  "Envelope Choukei 4" 
      QDEBUG : paper size = 255.118 x 581.102  =  QSizeF(90, 205)  =  "Envelope Choukei 4 Borderless" 
      QDEBUG : paper size = 311.811 x 623.622  =  QSizeF(110, 220)  =  "Envelope DL" 
      QDEBUG : paper size = 311.811 x 623.622  =  QSizeF(110, 220)  =  "Envelope DL Borderless" 
      QDEBUG : paper size = 522 x 756  =  QSizeF(184.15, 266.7)  =  "Executive" 
      QDEBUG : paper size = 522 x 756  =  QSizeF(184.15, 266.7)  =  "Executive Borderless" 
      QDEBUG : paper size = 612 x 1008  =  QSizeF(215.9, 355.6)  =  "US Legal" 
      QDEBUG : paper size = 612 x 1008  =  QSizeF(215.9, 355.6)  =  "US Legal Borderless" 
      QDEBUG : paper size = 612 x 792  =  QSizeF(215.9, 279.4)  =  "US Letter" 
      QDEBUG : paper size = 612 x 792  =  QSizeF(215.9, 279.4)  =  "US Letter Borderless" 
      

      Note that half those sizes are not supported by Qt at this time so will return a custom paper size.

      The solution is to use a set and then convert to a list to get rid of the duplicates. For supportedPaperSizes() we should probably remove the Custom size if custom paper sizes are not supported by the printer (how can we tell?).

      Attachments

        Issue Links

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

          Activity

            People

              johnlayt John Layt
              johnlayt John Layt
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes