Aarón Bueno Villares
2016-02-25 18:23:44 UTC
Since Wt makes some lifecycle management of its WObjects, I want to know if
a WAbstractItemDelegate (or any of its derived class of course), can be
shared between different columns, for example, if the content to be
rendered is similar, or must each column have its own delegate?
My concerns are the following ones:
*) If I create a WItemDelegate without a parent, does the view became
the owner of the newly inserted delegated? I assume that, if I used the
same delegate for more than one column, after the first insertion the
delegate already has a parent and there is no re-parenting.
*) In such a case of sharing, if the view is destroyed, does the view
try to delete each delegate for each column, or there's no risk of a
delegated being destroyed twice?
In conclusion, is it safe to use a same delegate object for more than one
column? and even for different views?
Best regards,
a WAbstractItemDelegate (or any of its derived class of course), can be
shared between different columns, for example, if the content to be
rendered is similar, or must each column have its own delegate?
My concerns are the following ones:
*) If I create a WItemDelegate without a parent, does the view became
the owner of the newly inserted delegated? I assume that, if I used the
same delegate for more than one column, after the first insertion the
delegate already has a parent and there is no re-parenting.
*) In such a case of sharing, if the view is destroyed, does the view
try to delete each delegate for each column, or there's no risk of a
delegated being destroyed twice?
In conclusion, is it safe to use a same delegate object for more than one
column? and even for different views?
Best regards,