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

List:       pykde
Subject:    Re: [PyKDE] Getting control over the Tab key
From:       Gordon Tyler <gordon () doxxx ! net>
Date:       2002-10-24 14:53:20
[Download RAW message or body]

Konrad Hinsen wrote:
> Phil Thompson <phil@river-bank.demon.co.uk> writes:
>>That's because you aren't keeping a reference to the FilterObject
>>instance so it gets garbage collected immediately.
> 
> I admit that the ownership details in PyQt still surprise me
> occasionally. How can installEventFilter() possibly work without
> keeping a reference on the object that is passed to it? What does it
> keep, if not a reference? If it kept just the address without
> increasing the Python reference counter, then my code should crash.

The way I understand it is that installEventFilter() is a Qt C++ 
function which itself knows nothing about Python object reference 
counting. Thus _you_ have to make sure that there is a reference to the 
object that you pass into it.

Ciao,
Gordon

_______________________________________________
PyKDE mailing list    PyKDE@mats.gmd.de
http://mats.gmd.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