Franček Prijatelj wrote:
> 
> In Qt you don't have to (or must not?) destroy child widgets.
> Parent widget is responsible for destruction of it's children.
> So you have to destroy only dynamicaly allocated top level (without
> parent)
> widgets.
> 

This is true if the widget is created with pure .cpp code
calling the constructors and destruction within from.

In Harbour-Qt we construct a widget with QWidget():new()
which allocates a pointer in HMV and we destruct that pointer 
through GC. It is only possible if we initiate destruction ourselves.

So if we destroy the top level, then the pointers created for
its children are never get freed, or if HVM frees it, it is not there
anymore. Though we have protection code in destructors, but 
it seems that is not enough, we need another approach.

Now I understand that for nested widgets, like treeview, I have to
start from the children then promoting to the parents while
destroying. I will try it today.



-----
                 enjoy hbIDEing...
                    Pritpal Bedi 
_a_student_of_software_analysis_&_design_
-- 
View this message in context: 
http://n2.nabble.com/SF-net-SVN-harbour-project-13957-trunk-harbour-tp4611158p4613809.html
Sent from the harbour-devel mailing list archive at Nabble.com.
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to