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

[Type Hints] Allow None as argument for QAbstractItemView.setModel and QGraphicsView.setScene

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 6.6.1, 6.5.4
    • 6.5.3
    • PySide, Type hints
    • None
    • All
    • 7004b3337 (dev), 6bafa39e1 (6.6), c4e0836a7 (6.5)

    Description

      QAbstractItemView.setModel as well as QGraphicsView.setScene can be reset (remove model or scene) by passing None. Nevertheless, this is not reflected in the typing (running mypy 1.5.1 against PySide 6.5.3):

      error: Argument 1 to "setModel" of "QHeaderView" has incompatible type "None"; expected "QAbstractItemModel"  [arg-type]
      error: Argument 1 to "setScene" of "QGraphicsView" has incompatible type "None"; expected "QGraphicsScene"  [arg-type]
      

       

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-2514
          # Subject Branch Project Status CR V

          Activity

            People

              kleint Friedemann Kleint
              tilmankrummeck Tilman Krummeck
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews