Problem with QAbstractItemModel.dataChanged
Tony Arnold
a.c.arnold at gmail.com
Mon Mar 6 14:25:28 GMT 2023
Hi Björn,
On Sat, 2023-03-04 at 17:59 +0100, Björn Künsting wrote:
> Hi,
>
> I am using PyQt6 on Linux and get the following error when decorating a
> function to receive QAbstractItemModel.dataChanged signals.
>
> TypeError: decorated slot has no signature compatible with
> dataChanged(QModelIndex,QModelIndex,QList<int>)
>
> The decorated function (inside a class):
>
> @pyqtSlot("QModelIndex", "QModelIndex", "QList<int>")
> def on_changed(self, tl: QModelIndex, br: QModelIndex, roles:
> List[int])
Shouldn't the type-hint the roles parameter be QList[int]? You have
just List[int].
I don't really understand what type-hints do, so I don't know if this
will work.
Regards,
Tony.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230306/f40d0cfa/attachment.htm>
More information about the PyQt
mailing list