By changing the FILLVIEWPORT parameter to false, the group's width is controlled by a data property rather than the viewport's width.

This sample works with the tree being in a group or not in a group -- the same TreeLayout is used for both. When not using a group and when FILLVIEWPORT is false, the tree's width is determined by a shared Model.modelData property.