Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-940

Calling setPageSize with QPageSize on QPrinter fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.2
    • 5.12.1
    • PySide
    • None
    • macOS
    • 5dcebb60c75b03cec2db63ecc618740a78d7f084 (pyside/pyside-setup/5.12)

    Description

      from PySide2.QtGui import QPageSize 
      from PySide2.QtPrintSupport import QPrinter 
      from PySide2.QtWidgets import QApplication 
      
      QApplication() 
      
      printer = QPrinter()
      pageSize = QPageSize() 
      printer.setPageSize(pageSize)
      

      fails with:

      TypeError: 'PySide2.QtPrintSupport.QPrinter.setPageSize' called with wrong argument types:
        PySide2.QtPrintSupport.QPrinter.setPageSize(QPageSize)
      Supported signatures:
        PySide2.QtPrintSupport.QPrinter.setPageSize(PySide2.QtGui.QPagedPaintDevice.PageSize)
      

      I suspect type checker is blocking calling setPageSize from parent class (QPagedPaintDevice).

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            krzysztof_sakowski Krzysztof Sakowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes