PDA

View Full Version : Qt::WA_DeleteOnClose - object persistance



ranna
4th June 2009, 08:08
Hi,

I have mdi Area as my central widget and added more than 2 sub windows in it. While closing a sub window i dont want to delete it (the destructor of the sub window should not get called). To make this i have set the Qt::WA_DeleteOnClose attribute as false. But I am not sure

1. on setting this attribute as false, is to not call destructor (or to not delete the object?).

And

2. After object destruction (with Qt::WA_DeleteOnClose is set to false), i can see that the widget has valid address but the QObjects inside the widget has got deleted. How to avoid this one?

In simple thing, On closing a sub window it should get hidden but in future if i click a icon the window should get appear again. I Have tried this with overriding the closeEvent function in which the close is ignored and hide() function has called. But the window is not disappeared instead it just grayed out.

Please clarify me on this.

Regards
ranna