[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] subclassing in pyqt
From: Boudewijn Rempt <bsarempt () rempt ! xs4all ! nl>
Date: 2000-12-23 22:52:10
[Download RAW message or body]
On Sat, 23 Dec 2000, Phil Thompson wrote:
> Here is a thought...
>
> As I've explained before, the C++ QListViewItem instance doesn't get
> deleted when the Python object is deleted because its ownership is
> transfered to the Qt code. What if I increased the reference count of
> the Python instance when ownership is transfered to Qt? Qt then has
> responsibility for deleting the reference count - and therefore the
> Python object would stick around even though you weren't holding an
> explicit reference in your Python code.
>
> This goes against my previously stated philosophy of not messing with
> reference counts under the covers - but I can't think of any new
> problems it would create.
>
> Anybody any thoughts on whether or not this would break anything?
>
I don't think it would break anything - if QListViewItems would get
deleted when the Python reference got deleted, yes, but you've got
to use QListView.takeItem() anyway.
I haven't got any strong feelings: in most application, you'd want
to keep a mapping between a listviewitem and the object that it
represents anyway, and then you've got your reference for free.
Boudewijn Rempt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic