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

[Type Hints] Typing of properties for QStyleOption classes are broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.5.3
    • Type hints
    • None
    • All

    Description

      It seems as if all properties of classes derived from QStyleOption are broken. Give the following example code:

       

      from PySide6.QtCore import QRectF
      from PySide6.QtWidgets import QStyleOptionGraphicsItem
      option = QStyleOptionGraphicsItem()
      option.exposedRect = QRectF(0, 0, 10, 10)
      

      Mypy will fail with the following error:

      error: "QStyleOptionGraphicsItem" has no attribute "exposedRect"  [attr-defined]

      Nevertheless, the property is valid: https://doc.qt.io/qt-6/qstyleoptiongraphicsitem.html#exposedRect-var

      Attachments

        Issue Links

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

          Activity

            People

              ctismer Christian Tismer
              tilmankrummeck Tilman Krummeck
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes