TypeError with QAbstractItemModel::checkIndex

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

TypeError with QAbstractItemModel::checkIndex

Florian Bruhin
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

Florian

--
https://www.qutebrowser.org | [hidden email] (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
         I love long mails! | https://email.is-not-s.ms/

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: TypeError with QAbstractItemModel::checkIndex

Phil Thompson-5
On 28 Nov 2018, at 10:47 am, Florian Bruhin <[hidden email]> 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
_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt