I heard that the widgets should be allocated on the heap (using new), and then there are no needs to delete them (it is done automatically).
- Can someone explain why?
- What happens if a widget is not allocated that way, but on a stack?
I am not sure if it matters, but all widgets I am creating have a parent.
This says :
See Question&Answers more detail:osIf parent is 0, the new widget becomes a window. If parent is another widget, this widget becomes a child window inside parent. The new widget is deleted when its parent is deleted.