Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.1.3
-
None
-
Debian 10.10 Buster
PySide2 5.15.2
Python 3.7.3
Description
documentation:
https://doc.qt.io/qtforpython-5/PySide2/QtCore/QModelIndex.html#PySide2.QtCore.PySide2.QtCore.QModelIndex.model
says, the return type of model() is a
QAbstractItemModel,
but print(type(model_index.model())) shows
<class 'PySide2.QtGui.QStandardItemModel'>
(run the attached Python script)
problem:
modelIndex.model() returns QStandardItemModel
modelIndex.model() should return QAbstractItemModel
the difference are the signatures:
(1) modelIndex.model().index(row, col ) for QStandardItemModel
(2) modelIndex.model().index(row, col, parentIndex) for QAbstractItemModel
so,
with (1) I never get the proper item in non-trivial trees,
which (2) would allow
I guess that QStandardItemModel.index() has inadvertentlt dropped the 3rd parameter, because just the first two does not make sense.