OK, thanks. This is exactly what I was referring to when I asked if deleting a child removed it from its parent's list of children. So my "extra" deletes do no harm (but don't do much good, either). Away with them!Qt Code:
if(parent()) parent()->children().remove(this); // of course ignoring that children() returns a copy m_parent = newParent; if(m_parent) m_parent->children().append(this); // of course ignoring that children() returns a copy }To copy to clipboard, switch view to plain text mode
Ok, I had known that also, but was trying to keep the explanation more simple.The child widget is reparented to the widget and not to the layout.




Reply With Quote
Bookmarks