[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] Model indexes and internal pointers
From:       "Arve Knudsen" <arve.knudsen () gmail ! com>
Date:       2006-07-17 20:00:41
Message-ID: a0d6258d0607171300o5c380abah95821b922c011cd9 () mail ! gmail ! com
[Download RAW message or body]

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 <apaku@gmx.de> 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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic