0
TreeView
에서 뭔가를 선택하거나 클릭 할 때 QML TreeView
의 행 번호를 가져 오는 방법이 있습니까? 예를 들어 TableView
의 경우 currentRow
을 사용합니다. TreeView
에 해당하는 항목이 있습니까?QML TreeView의 현재 행을 가져 오는 방법은 무엇입니까?
TreeView
에서 뭔가를 선택하거나 클릭 할 때 QML TreeView
의 행 번호를 가져 오는 방법이 있습니까? 예를 들어 TableView
의 경우 currentRow
을 사용합니다. TreeView
에 해당하는 항목이 있습니까?QML TreeView의 현재 행을 가져 오는 방법은 무엇입니까?
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)
}
}
.