Important: Please read the Qt Code of Conduct -

Background color for TreeView

  • Hi
    I want to set a background colour for my tree view but cannot find a way.
    Say I have the following

    Rectangle {
        width: 800
        height: 800
        anchors.fill: parent
        TreeView {
            id: view
            model: theModel

    What do I need to set a background color?
    Setting a color on the parent does not work and I cannot see how to use TreeViewStyle to do this.

    Can anyone please help?

Log in to reply