How to scroll to certain row in QML TreeView

2019-08-21 23:38发布

问题:

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)