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

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

      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]
      

       

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

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

              Created:
              Updated:
              Resolved: