[PyKDE] Re: Signal destroyed() not emitted for QWidget

Giovanni Bajo rasky at develer.com
Tue Feb 14 16:28:04 GMT 2006


Phil Thompson <phil at riverbankcomputing.co.uk> wrote:

> I think this is the way Qt works when the receiver is a child of the
sender.
> When PyQt3 makes a connection to a Python callable it creates a proxy
> QObject that is actually connected to the sender. To make sure the proxy
> doesn't leak memory it is made a child of the sender.
>
> If I write a C++ program similar to your test where the receiver is a
child
> of the sender then it behaves in the same way.
>
> If I modify the C++ program so that the receiver is not a child of the
> sender, but instead also connects to the sender's destroyed() signal so
> that it can call deleteLater() on itself - then it seems to behave as you
> were expecting.
>
> I'll probably make a change in the next snapshot or so.

Thanks. But why does it work for QObject and not for QWidget?
-- 
Giovanni Bajo




More information about the PyQt mailing list