Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.6.0
-
None
-
QML
Description
Add a function in TreeView in order to can change the selected row with a model index.
TreeView.qml line 86
function selectRow(index) { var row = 0; var indexList = []; while (index.valid) { indexList.push(index); index = index.parent; } while (indexList.length > 0) { var targetIndex = indexList.pop(); while (modelAdaptor.mapRowToModelIndex(row) !== targetIndex) { if (!modelAdaptor.mapRowToModelIndex(row).valid) { console.warn("Row not found") return; } row++; } if (indexList.length > 0) { expand(modelAdaptor.mapRowToModelIndex(row)); } } __currentRow = row; }