PDA

View Full Version : How to keep a widget after its parent widget death?



dongli
4th July 2009, 04:31
Hi,

I created a wizard, and gave it an argument that points to a layout. Then the content of the layout is presented on one page. The problem is that when the wizard is closed, the layout is also deleted. I want to keep the content of that layout. How to do this?

DONG Li

That is how to remove the relationship between parent widget and child widget?

wysota
4th July 2009, 07:56
child->setParent(0);

dongli
4th July 2009, 08:04
Hi, wysota,

I didn't use setParent, and it works.:confused:



groupBoxList_dataFormat->at(i)->setLayout(binaryDataFormatUI->at(i)->layout);


Maybe it besause binaryDataFormatUI->at(i)->layout is not declared with setting groupBoxList_dataFormat->at(i) as parent.

wysota
4th July 2009, 09:01
If you move a layout to another widget (if that's possible) then the widgets in a layout get reparented to the new widget.