Re: how to delete a widget
Your trying to delete this object in its own function which is dangerous(object self destruction).
May be you can use this->deleteLater(); in this case.
But destroying self object is bad idea.
What is your requirement.?
Re: how to delete a widget
im running this executable in ARM based board which is having very less memory.Actually im using 4 widgets in my application,so if i delete the widget while calling another , i can save the memory thats the reason im looking for.
Re: how to delete a widget
As prasad_N said, use deleteLater() if you do it inside the widget.
If you need to delete the current widget before you create the new one, then you need to emit a signal, connect it to some slot using a Qt::QueuedConnection and in the slot first delete the current widget, then create the new one.
Cheers,
_