如何滚动到 QML TreeView 中的特定行

How to scroll to certain row in QML TreeView

TreeView 中,通过单击选择一行。 但是我想通过指示行 QModelIndexroleName.

来关注 TreeView 中的行

我在ListView中发现了类似的功能:

positionViewAtIndex(int index, PositionMode mode)

如何在 TreeView 中执行此操作?

尝试使用隐藏变量__listView。

__listView.positionViewAtIndex(row, mode)