PDA

View Full Version : delete QWidget



yxtx1984
10th March 2010, 03:33
As we know a widget is will be delete when the parent is delete, but if i just want to delete itself without release the parent, how to do this?
Is it conflict with the rules of Qt?

aamer4yu
10th March 2010, 04:17
Simply delete the widget. It doesnt conflict. Its C++.
Qt only simplifies you garbage management by deleting the childs if the parent is deleted. It doesnt restrict you to delete the child explicitly and doesnt result in error if you do so.