[PyKDE] Destructor trouble (how to get rid of child widgets ?)

Pete Ware ware at cis.ohio-state.edu
Sat May 20 17:03:14 BST 2000


Thomas Malik <Thomas.Malik at t-online.de> writes:

> 2. No idea, how object destruction works in sip/PyQt, but it should
> definitely be checked. What i would normally expect is, that when
> loosing the last reference to Python object, the underlying C++/Qt
> Object must be deallocated by it's destructor. That's also true for
> objects passed into/connected to the Qt framework (subwidgets, for
> instance).
It used to be the case that you had to keep a python reference for
_every_ qt widget created.  It was very annoying.  I think the latest
model (>= .10?) is so it should work much like in C++.  When a qObject keeps
track of a child, then PyQt doesn't -- just like using "new" in C++
and when the "qObject *objptr;" goes out of scope, nothing happens.

Now, I'd think calling "del" on some parent would do the right thing.
Maybe you can right a small example?

> 3. How about some more documentation on sip ...? I mean, i would
> really like to contribute to this work (i'm using it at work) , but
> it's basically impossible because there are way too few lines of
> comments in the sip source code, and no documentation so far. I've got
> a long experience of C++ programming and am sure i am able to
> contribute somehow.
I'm working on it and I'm hoping to have a reasonable pass within two
weeks (about the end of the month).

--pete




More information about the PyQt mailing list