Important: Please read the Qt Code of Conduct -

Select only item in TreeView

  • Hi!

    I have next TreeView in QML:

    TreeView {
        id: tree
        width: 300
        model: pgItemModel
        headerVisible: false
        TableViewColumn {
            resizable: true
            role: "display"

    When user selects a tree item, entire row will be highlighted:
    Full row selection
    But better if only tree item will be highlighted, as in the following example:
    Item selection
    How can I do this?

Log in to reply