ReferenceError error after calling TreeView.forceLayout in Qt 6.5
Unsolved
QML and Qt Quick
-
I have a tree view in a popup. The code looks like this:
Popup { id: root TreeView { id: treeView ...... model: myModel delegate: TreeViewDelegate { indicator: Image { ...... MouseArea { ..... onClicked: { if (myModel.canFetchMore(index)) { myModel.fetchMore(index); } treeView.expand(row); treeView.forceLayout(); // Got **ReferenceError: treeViewItem is not defined** in the next line treeView.positionViewAtRow(row, TreeView.AlignTop); // If I call some property in root, it will report **ReferenceError: root is not defined** } } } } } }
Does anyone know the reason of the error?
Thanks in advance.