How to scroll to certain row in QML TreeView

2019-08-21 23:56发布

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条回答
做自己的国王
2楼-- · 2019-08-22 00:21

Try to use hidden variable __listView.

__listView.positionViewAtIndex(row, mode)
查看更多
登录 后发表回答