[PyQt] QModelIndex.internalPointer Bug

Andres Ulloa andresdulloa at gmail.com
Tue Jun 6 18:14:55 BST 2017


Sure. I've attached a short demonstration script.

Thanks,
Andres

On Tue, Jun 6, 2017 at 1:22 AM, Phil Thompson <phil at riverbankcomputing.com>
wrote:

> On 6 Jun 2017, at 1:00 am, Andres Ulloa <andresdulloa at gmail.com> wrote:
> >
> > 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.
> >
> > Example
> > ------------
> > 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.
>
> I would need a complete (short) script that demonstrates the problem.
>
> Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170606/0feaa641/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scratch_16.py
Type: application/octet-stream
Size: 350 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170606/0feaa641/attachment-0001.obj>


More information about the PyQt mailing list