Trying to emit the QAbstractItemModel.layoutAboutToChange signal with the parents list and/or the LayoutChangeHint raises a TypeError
from PySide6.QtCore import Qt, QAbstractListModel
class SkeletonModel(QAbstractListModel):
def rowCount(self, parent):
return 0 if parent.isValid() else 3
def data(self, index, role=Qt.DisplayRole):
return None
def sort(self, column, order=Qt.AscendingOrder):
self.layoutAboutToBeChanged.emit([], QAbstractListModel.VerticalSortHint)
self.layoutChanged.emit([], QAbstractListModel.VerticalSortHint)
m = SkeletonModel()
m.sort(0)
Traceback (most recent call last):
File "script.py", line 17, in <module>
m.sort(0)
File "script.py", line 13, in sort
self.layoutChanged.emit([], QAbstractListModel.VerticalSortHint)
TypeError: layoutChanged() only accepts 0 argument(s), 2 given!
The same error (lack or an overload) seems to also affect layoutChanged signal. Same behaviour in PySide2 and PySide6.