Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.15.19, 5.15
-
None
Description
一个 TreeView 的问题(5.15),折叠一个目录时,没有收起子节点的 View。
排查下来问题出在 QQuickTreeModelAdaptor1::lastChildIndex 中。这个方法没有考虑 rootIndex,到了 root 还没有退出 while 循环。
In English:
A TreeView issue (5.15), when collapsing a directory, the sub-node View is not collected.
The problem lies in QQuickTreeModelAdaptor1 :: lastChildIndex. This method does not consider rootIndex, and it has not exited the while loop when it reaches root.
How to reproduce:
- Use FileSystem TreeView demo from Qt
- Create a directory struct:
test
- 1
- 2
- 3
- 4
- README.txt
- 5
- fsm->setRootPath("D:/test");
- engine.rootContext()
>setContextProperty("rootPathIndex", fsm>index(fsm->rootPath() + "/1/2")); - start program
- expand directory 3 and 4
- fold directory 3 and it does't fold
- expand directory 3 again, it will create duplicate nodes (as the second picture)
See test.zip and filesystembrowser.zip