[PyQt] TypeError with QAbstractItemModel::checkIndex

Florian Bruhin me at the-compiler.org
Wed Nov 28 10:47:33 GMT 2018


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 | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
         I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20181128/cd416ec3/attachment-0001.sig>


More information about the PyQt mailing list