2016-11-07 12 views

答えて

1

currentIndexを使用してください。 documentationの詳細例えば

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) 
    } 
} 

あなたはGitHubの中the complete exampleを確認することができます。

関連する問題