问题
In TreeView, selecting a row by clicking it.
But I want to focus the row in TreeView by indicating the row QModelIndex and roleName.
I found similar function in ListView:
positionViewAtIndex(int index, PositionMode mode)
How to do this in TreeView?
回答1:
Try to use hidden variable __listView.
__listView.positionViewAtIndex(row, mode)
来源:https://stackoverflow.com/questions/46441998/how-to-scroll-to-certain-row-in-qml-treeview