[PyQt] Fwd: QModelIndex.internalPointer Bug

Andres Ulloa andresdulloa at gmail.com
Tue Jun 6 01:00:13 BST 2017

The behavior of the bug is that python crashes when you create an index
with a pointer to an instantiated object's attribute, and then try to
access that pointer using the internalPointer method.


class foo:
    def __init__(self):
        self.bar = 2

class TreeModel(QtCore.QAbstractItemModel):
    def __init__(self, parent=None):
        super(TreeModel, self).__init__(parent)
        self.foo = foo()
        ind = self.createIndex(1,1,self.foo.bar)
        print ind.internalPointer()

Any help would be appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170605/cf23073c/attachment.html>

More information about the PyQt mailing list