The primary method for combining a number of widgets in a composite widget is a WContainerWidget. This widget corresponds to an HTML <span> or <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.
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: