[PyQt] causes self to be owned by Qt instead of PyQt ???

Phil Thompson phil at riverbankcomputing.com
Mon Mar 30 11:32:44 BST 2015


On 30/03/2015 11:15 am, redstone-cold wrote:
> In the QObject.__init__(self, Parent=None) documentation it states:
> 
> The parent argument, if not None, causes self to be owned by Qt instead 
> of PyQt.
> 
> What does it mean to be owned by Qt instead of PyQt? Does this have
> effects on behavior that I should be aware of when developing a PyQt
> application?

It means that Qt will call the dtor of the C++ instance when necessary 
and it may still exist even if the Python object that wraps it is 
garbage collected. Generally you don't need to worry about it.

Phil


More information about the PyQt mailing list