I looking into source code of SplitView (%QT_SOURCE_PATH%\qml\QtQuick\Controls\SplitView.qml) and noticed that it used 3 Items to maipulate splitters and items:
Item {
id: contents
visible: false
anchors.fill: parent
}
Item {
id: splitterItems
anchors.fill: parent
}
Item {
id: splitterHandles
anchors.fill: parent
}
According to code, new items is placing into item splitterItems by the function addItem_impl(item). The fuction addItem_impl(item) are called from function init() that pass every child item from Item with id contents. But I wonder how all the children from root item were placed into contents Item?
Via a default property:
default property alias __contents: contents.data
From the documentation:
An object definition can have a single default property. A default property is the property to which a value is assigned if an object is declared within another object's definition without declaring it as a value for a particular property.
[...]
You will notice that child objects can be added to any Item-based type without explicitly adding them to the children property. This is because the default property of Item is its data property, and any items added to this list for an Item are automatically added to its list of children.
Default properties can be useful for reassigning the children of an item. See the TabWidget Example, which uses a default property to automatically reassign children of the TabWidget as children of an inner ListView. See also Extending QML.