[Qt-interest] show a widget without a main window

Andreas Pakulat apaku at gmx.de
Mon Mar 9 17:53:19 CET 2009


On 09.03.09 19:25:18, Knowledge Seeker wrote:
> Thanks for throwing more light on it.
> And I am programming since the days of DOS, in which it definitely was a 
> memory leak :-).
> 
> So keeping the above in mind what do you say for the example code given at:
> http://doc.trolltech.com/4.4/tutorials-tutorial-t4.html
> 
> Isn't QPushButton *quit object causing a memory-leak ! ? !

No, because it has this as parent, which means it'll be deleted when this
is deleted (i.e. the widget).  Thats what people said at the start of this
thread, qobject-parent-child relationships relieves you from memory
management, as long as you delete the top-level qobject of your
objec-tree's at some point.

Andreas

-- 
Don't relax!  It's only your tension that's holding you together.



More information about the Qt-interest-old mailing list