Ok, I found the original thread. There is no explanation as to why no
extra reference is kept however. There might be a good reason for this
behaviour, but it does represent a rather nasty pitfall.

Arve

On 7/17/06, Andreas Pakulat <[EMAIL PROTECTED]> wrote:
On 16.07.06 12:34:34, Arve Knudsen wrote:
> Phil: Might it be an idea to make QModelIndex update the reference
> count for its "internalPointer"? This is only a suggestion on my part,
> as I'm in not an expert on Python/C++ interfacing. I just resolved
> some mysterious segfaults in an application of mine to a temporary
> Python object being stored in a QModelIndex, and some robustness
> towards this sort of thing in PyQt would be great.

When Phil implemented this and announced it here on the list he clearly
stated that you need to save a reference to the object that you put into
the internalPointer of an index. The sections on the createIndex methods
need this warning, but the docs for PyQt4 are a Work In Progress still.

Andreas

--
You are going to have a new love affair.

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to