2016-11-07 3 views

답변

1

currentIndex을 사용해야합니다. documentation에 대한 자세한 정보. 예를 들어

: 당신은 GitHub의에서 the complete example을 확인할 수 있습니다

TreeView { 
    id: myTree 
    ... 
    model: myModel 

    onCurrentIndexChanged: console.log("current index: " + currentIndex 
             + " current row: " + currentIndex.row) 

    TableViewColumn { 
     title: "title1" 
     role: "role1" 
    } 

    TableViewColumn { 
     title: "title2" 
     role: "role2" 
    } 

    onClicked: { 
     console.log("clicked", index) 
    } 
} 

.