My application calls another widget from the current and i never need the previous widget.
So i want to kill the parent widget to avoid memory leak.
I want to solve this problem as my widgets chains a lot.
Can anybody help?
Mahe2310
My application calls another widget from the current and i never need the previous widget.
So i want to kill the parent widget to avoid memory leak.
I want to solve this problem as my widgets chains a lot.
Can anybody help?
Mahe2310
a life without programming is like an empty bottle![]()
Originally Posted by zlatko
If i am reusing it again. then ?![]()
pWidget name should be a global variable.. Right???
that means all the widgets should be global...
But if we are declaring these widget together in a header file and calls the header file by each of the file,
then redeclaration error is generated.
If i declare them static in the headers then once we delete it will not be created again.
Mahe2310
Try setting Qt::WA_DeleteOnClose attribute or invoking QObject::deleteLater(), but make sure that "parent" widget is not a parent of other windows, because it will delete them also. Another alternative is to turn your windows into singletons and just hide them when you don't need them.
Bookmarks