Qt 6.4 Treeview in qml
-
I want to create treeview using qt 6.4 in QT Design Studio but indicator not visible. Please help me with the implementation.
My code:
import QtQuick 6.4 import QtQuick.Controls 6.4 import Qt.labs.folderlistmodel 2.1 import QtQuick.Studio.Components 1.0 TreeView { id: folderSystemView x: 0 y: 0 width: 412 height: 500 clip: true model: FolderListModel { id: folderModel folder: "file:///E:" nameFilters: ["*"] showDirs: true } delegate:TreeViewDelegate { id: control background: Rectangle { implicitHeight: 40 color: control.highlighted ? control.palette.highlight : (control.treeView.alternatingRows && control.row % 2 !== 0 ? control.palette.alternateBase : control.palette.base) } indicator: SvgPathItem{ height:40 width:40 fillColor: "#000000" path: "M350.45,277.5l-164.08,94.73c-16.55,9.56-37.24-2.39-37.24-21.5V161.27c0-19.11,20.69-31.06,37.24-21.5 l164.08,94.73C367,244.06,367,267.94,350.45,277.5z" } contentItem: Label { clip: false text: model.fileName elide: Text.ElideRight color: control.highlighted ? control.palette.highlightedText : control.palette.buttonText visible: !control.editing } } }