[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-18 8:35:17
Message-ID: a0d6258d0607180135q79feed6ax145de204c4a9a632 () mail ! gmail ! com
[Download RAW message or body]

On 7/18/06, David Boddie <david@boddie.org.uk> wrote:
> On Tue Jul 18 00:23:47 MEST 2006, Phil Thompson wrote:
> > There are plenty of other places where you have to keep an external
> > reference to stop an object being garbage collected causing a crash. I just
> > need to decide if this is worth making a special case.
>
> I'm in favour of allowing model indexes to take references to Python objects,
> as long as everyone realises that you can't store objects in indexes and
> expect to get them back later. However, model indexes are supposed to be
> lightweight objects and there may be a performance penalty to pay for adding
> extra code to manage object reference counting.

When you say that model indexes are temporary, do you mean that if one
keeps a reference to a wrapping Python object, the underlying C++
object may still get destroyed? That doesn't apply to my case at
least, I only need to access indexes' associated data in reimplemented
model methods (such as data()).

Anyway, I think that models and views are so integral to Qt
programming now that some robustness towards passing data between them
should definitely be considered.

Arve

_______________________________________________
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