The primary method for combining a number of widgets in a composite
widget is a WContainerWidget. This widget corresponds to an
<div> element (depending on
whether it is inline or not). It can contain any number of children, and
these children may be added or removed dynamically.
Alternatives to consider are a WTemplate, which puts widgets inside an HTML fragment using placeholder substitution, or a WTable for organizing children in a table (without using a layout manager).
The container takes ownership of its children: when the parent is deleted, the children will be deleted as well. This does not stop you from deleting a child widget, as this also automatically removes it from the parent.
There are several specialized container classes that have additional markup or behaviour: