[PyQt] QAbstractItemModel::data and invalid QVariant

Florian Bruhin me at the-compiler.org
Tue Feb 21 05:31:53 GMT 2017


the Qt docs for QAbstractItemModel::data say[1]:

    Note: If you do not have a value to return, return an invalid
    QVariant instead of returning 0.

Yet returning None from Python seems to work fine. What happens behind
the scenes there? Does PyQt convert the None I return to a null
pointer, or to an invalid QVariant?


[1] http://doc.qt.io/qt-5/qabstractitemmodel.html#data

http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://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/20170221/f837cce5/attachment.sig>

More information about the PyQt mailing list