HorizontalHeaderView { id: horizontalHeaderWidget anchors.left: parent.left anchors.top: parent.top anchors.right: parent.right syncView: treeViewWidget boundsBehavior: Flickable.StopAtBounds clip: true interactive: false resizableColumns: false delegate: Rectangle { id: delegateItem required property var model required property int column clip: true implicitHeight: 40 implicitWidth: 200 color: "gray" Text { id: textWidget anchors.left: parent.left anchors.leftMargin: 10 anchors.verticalCenter: parent.verticalCenter text: model.display color: "white" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter font.pixelSize: 14 } } } TreeView { id: treeViewWidget anchors.left: horizontalHeaderWidget.left anchors.right: horizontalHeaderWidget.right anchors.top: horizontalHeaderWidget.bottom anchors.bottom: parent.bottom anchors.margins: 5 clip: true ScrollBar.vertical: MyScrollBar { policy: ScrollBar.AsNeeded } editTriggers: TableView.DoubleTapped boundsBehavior: Flickable.StopAtBounds model: TestProxyModel { id: proxyModel } delegate: Component { Rectangle { required property TreeView treeView required property bool isTreeNode required property bool expanded required property int hasChildren required property int depth required property int row required property int column required property bool current implicitWidth: treeView.width / 3 implicitHeight: 35 color:"gray" Row { id: paddingItem anchors.left: parent.left height: parent.height Repeater { model: depth Item { width: indicatorLoader.width height: parent.height Rectangle { anchors.horizontalCenter: parent.horizontalCenter width: 1 height: parent.height color: "gray" } } } } Loader { id: indicatorLoader anchors.left: paddingItem.right anchors.verticalCenter: parent.verticalCenter height: 30 width: hasChildren ? 30 : (depth === 0 ? 0 : 30) active: hasChildren sourceComponent: Component { MyButton { id: indicatorWidget anchors.fill: parent iconRotation: expanded ? 0 : -90 duration: 0 display: Button.IconOnly source: "qrc:/Img/Arrow2.svg" backgroundColor: "transparent" iconColor:"gray" cursorShape: Qt.PointingHandCursor onClicked: { treeView.toggleExpanded(row); } } } } MyRectangle { id: contentWidget anchors.left: indicatorLoader.right anchors.leftMargin: -5 anchors.right: parent.right height: 30 anchors.verticalCenter: parent.verticalCenter color: "green" radius: 5 Text { anchors.left: parent.left anchors.leftMargin: 5 anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right verticalAlignment: Text.AlignVCenter text: model.display color: "white" elide: Text.ElideRight font.pixelSize: 15 } } } } }