use selection model of TreeView

This commit is contained in:
vladest 2017-09-14 15:36:12 +02:00
parent d3dbd431d6
commit 7233c47257
2 changed files with 4 additions and 4 deletions

View file

@ -387,9 +387,9 @@ ScrollingWindow {
readOnly: true readOnly: true
Connections { Connections {
target: treeView target: treeView.selection
onCurrentIndexChanged: { onCurrentIndexChanged: {
var path = scriptsModel.data(treeView.currentIndex, 0x100) var path = scriptsModel.data(treeView.selection.currentIndex, 0x100)
if (path) { if (path) {
selectedScript.text = path selectedScript.text = path
} else { } else {

View file

@ -416,9 +416,9 @@ Rectangle {
readOnly: true readOnly: true
Connections { Connections {
target: treeView target: treeView.selection
onCurrentIndexChanged: { onCurrentIndexChanged: {
var path = scriptsModel.data(treeView.currentIndex, 0x100) var path = scriptsModel.data(treeView.selection.currentIndex, 0x100)
if (path) { if (path) {
selectedScript.text = path selectedScript.text = path
} else { } else {