Details
Description
Classes inherited from QAbstractItemModel that implement index() will call createIndex(row, column, item). For a tree view you get the child item from the parent and you don't have the internal pointer to it. In the past (including PySide2 5.11.2) and with current PyQt5 passing the bare child item as the 3rd argument to createIndex() has worked fine. As of PySide2 5.12.0 I get:
TypeError: 'PySide2.QtCore.QAbstractItemModel.createIndex' called with wrong argument types
The attached is a simple example.
Attachments
Issue Links
- relates to
-
PYSIDE-2762 Wrong type hint for QModelIndex.internalPointer
- Closed
- resulted in
-
PYSIDE-915 Typesystem created functions don't get injected in child classes
- Closed
For Gerrit Dashboard: PYSIDE-883 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
249231,4 | [reg] Remove createIndex method that uses PyObject* | 5.12 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
562842,2 | Fix type hint of QModelIndex.internalPointer() | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
562907,3 | Fix type hint of QModelIndex.internalPointer() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |