如何更改TreeView中指示器的颜色? 我尝试使用分支委托
style: TreeViewStyle
{
branchDelegate: {
color: "red"
}
}
答案 0 :(得分:1)
以source code为基础,解决方法如下:
style: TreeViewStyle {
branchDelegate: Item {
width: indentation
height: 16
Text {
visible: styleData.column === 0 && styleData.hasChildren
text: styleData.isExpanded ? "\u25bc" : "\u25b6"
color: "red" //!control.activeFocus || styleData.selected ? styleData.textColor : "#666"
font.pointSize: 10
renderType: Text.NativeRendering
style: Text.PlainText
anchors.centerIn: parent
anchors.verticalCenterOffset: 2
}
}
}