How to scroll to certain row in QML TreeView

℡╲_俬逩灬. 提交于 2019-12-13 02:58:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!