diff options
Diffstat (limited to 'src/quickcontrols/fusion/TreeViewDelegate.qml')
-rw-r--r-- | src/quickcontrols/fusion/TreeViewDelegate.qml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/quickcontrols/fusion/TreeViewDelegate.qml b/src/quickcontrols/fusion/TreeViewDelegate.qml index f8bbfb24b8..195693614b 100644 --- a/src/quickcontrols/fusion/TreeViewDelegate.qml +++ b/src/quickcontrols/fusion/TreeViewDelegate.qml @@ -64,6 +64,7 @@ T.TreeViewDelegate { // The edit delegate is a separate component, and doesn't need // to follow the same strict rules that are applied to a control. // qmllint disable attached-property-reuse + // qmllint disable controls-attached-property-reuse // qmllint disable controls-sanity TableView.editDelegate: FocusScope { width: parent.width @@ -71,7 +72,7 @@ T.TreeViewDelegate { readonly property int __role: { let model = control.treeView.model - let index = control.treeView.modelIndex(column, row) + let index = control.treeView.index(row, column) let editText = model.data(index, Qt.EditRole) return editText !== undefined ? Qt.EditRole : Qt.DisplayRole } @@ -81,17 +82,18 @@ T.TreeViewDelegate { x: control.contentItem.x y: (parent.height - height) / 2 width: control.contentItem.width - text: control.treeView.model.data(control.treeView.modelIndex(column, row), __role) + text: control.treeView.model.data(control.treeView.index(row, column), __role) focus: true } TableView.onCommit: { - let index = TableView.view.modelIndex(column, row) + let index = TableView.view.index(row, column) TableView.view.model.setData(index, textField.text, __role) } Component.onCompleted: textField.selectAll() } // qmllint enable attached-property-reuse + // qmllint enable controls-attached-property-reuse // qmllint enable controls-sanity } |