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

QWidget.render missing default parameter argument

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P4: Low
    • None
    • 6.5.2
    • PySide
    • None
    • All

    Description

      QWidget.render docs, both Python and C++ indicate that the QWidget.render method can take just a QPaintDevice or QPainter and no more, with the rest of the parameters being provided with defaults.

      Presently, if you do not provide a QPoint, you will get a TypeError indicating QWidget.render was called with the wrong argument types.

      If you call render with just a QPainter you get this:

      TypeError: 'PySide6.QtWidgets.QWidget.render' called with wrong argument types:
        PySide6.QtWidgets.QWidget.render(QPainter)
      Supported signatures:
        PySide6.QtWidgets.QWidget.render(PySide6.QtGui.QPainter, PySide6.QtCore.QPoint, Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect] = Default(QRegion), PySide6.QtWidgets.QWidget.RenderFlag = Instance(QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren)))
        PySide6.QtWidgets.QWidget.render(PySide6.QtGui.QPaintDevice, PySide6.QtCore.QPoint = Default(QPoint), Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect] = Default(QRegion), PySide6.QtWidgets.QWidget.RenderFlag = Instance(QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren)))
      

      See attached example.

      void QWidget::render(QPaintDevice *target, const QPoint &targetOffset = QPoint(),
         const QRegion &sourceRegion = QRegion(), 
         QWidget::RenderFlags renderFlags = RenderFlags(DrawWindowBackground | DrawChildren))
      
      void QWidget::render(QPainter *painter, const QPoint &targetOffset = QPoint(), 
           const QRegion &sourceRegion = QRegion(), 
          QWidget::RenderFlags renderFlags = RenderFlags(DrawWindowBackground | DrawChildren))
      
       explicit QPainter(QPaintDevice *);
      

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            kkyzivat Keith Kyzivat
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes