[PyQt] how does sip detect when an object has been deleted by C++
cournia at gmail.com
Wed Mar 17 03:57:14 GMT 2010
I've just started using SIP and have run into some questions. First, given
the following pseudo sip code:
// basically does "return new Foo;"
// basically does "delete foo;"
deleteFoo(Foo* foo /Transfer/);
Now let's look at some pseudo python code:
# creates a Foo* object
a = createFoo()
# deletes the created Foo* object
# returns false
I would have expected sip.isdeleted(a) to return true.
If I modify the definition of Foo to inherit from QObject like so:
struct Foo: QObject
with Foo inheriting from QObject, the code above will return true at
Which brings me to my question: How does SIP detect that the C++ code in
deleteFoo() deleted the QObject inherited Foo object? Could you point me to
the code which does this detection? I've looked over the documentation and
source code, but haven't found anything describing the actual mechanism.
My hope is to understand how this detection works, and possibly use
something similar to track when objects are deleted without having to
inherit from QObject.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt