[PyQt] TypeError with QAbstractItemModel::checkIndex

Phil Thompson phil at riverbankcomputing.com
Wed Nov 28 15:00:52 GMT 2018


On 28 Nov 2018, at 10:47 am, Florian Bruhin <me at the-compiler.org> wrote:
> 
> Hi,
> 
> something seems to be weird about QAbstractItemModel::checkIndex:
> 
>>>> from PyQt5.QtGui import QStandardItemModel
>>>> from PyQt5.QtCore import QModelIndex, QAbstractItemModel
>>>> m = QStandardItemModel()
>>>> idx = m.createIndex(0, 0)
>>>> m.checkIndex(idx, QAbstractItemModel.CheckIndexOption.IndexIsValid)
>  TypeError: an integer is required (got type CheckIndexOption)
> 
>  The above exception was the direct cause of the following exception:
> 
>  Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
>  SystemError: <built-in method checkIndex of QStandardItemModel object at 0x7f84247b1948> returned a result with an error set

Should be fixed in tonight's sip snapshot. It's a sip module change - no need to re-build PyQt.

Thanks,
Phil


More information about the PyQt mailing list