Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Fine-tuning branch indicator



  • In general, branch indicators behave like this:

    alt text

    I'd like to further fine-tune images inside my branch indicator by TreeViewStyle like this:

    TreeView {
        ...
        style: TreeViewStyle {
            indentation: 25
            branchDelegate: Item {
                visible: true // ** visible
                width: 20
                height: 10
                Image {
                    // I want this image to be visible only if item has children:
                    visible: styleData.hasChildren
                    width: 10
                    height: 10
                    ...
                    source: "images/arrow.png"
                    transform: Rotation {
                        origin.x: 10 / 2
                        origin.y: 10 / 2
                        angle: styleData.isExpanded ? 0 : -90
                    }
                }
                Image {
                    // I want this image to be always visible:
                    visible: true
                    width: 10
                    height: 10
                    ...
                }
            }
        }
        ...
    }
    

    My above visibility setup is NOT taking effect. Am I missing something?


Log in to reply