[PySide] Form dialog subclassing QDialog

Matthew Woehlke mw_triad at users.sourceforge.net
Mon Mar 3 17:35:50 CET 2014


On 2014-03-03 07:15, Philip Starkey wrote:
> Matthew Woehlke writes:
> I just want to add to this: if you have specified a parent widget when
> instantiating the QDialog, it is not destroyed until the parent widget is
> destroyed.

This is a pyside-ism? The parent QObject takes an additional Python 
reference to the child? (I'm pretty sure this doesn't happen in C++...)

Though you bring up another point; parented QObjects (at least in C++) 
are destroyed when their parents are destroyed, which I would assume 
bypasses Python's refcounting? (Maybe the Python object would still 
exist, but would be invalid.) So that's something else to keep in mind, 
but probably rarely relevant (it's unusual that the parent would be 
destroyed while you still care about the child).

-- 
Matthew




More information about the PySide mailing list