Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.10.1
-
None
Description
I noticed that incrementally updating the model view for a QML TreeView using beginInsertRows and endInsertRows doesn't work as expected when the rows are expanded.
My tree looks as follows:
- root
- node1
- subnode1
- node2
- subnode2
- node3
- node1
When I insert a new node between node2 and node3 using beginInsertRows(rootIndex, 2, 2), the new node4 is shown after node3, which is wrong.
However, when I fold/close the expanded node2 branch and do the same insert, the node4 is correctly inserted between node2 and node3.
I verified that my model is not the problem, but instead, the QML TreeView seems to behave incorrectly. Emitting layoutChanged() after the insert operation correctly updates the TreeView.
Attachments
Issue Links
- duplicates
-
QTBUG-66062 TreeView messes up its layout when inserting a new item after an open item branch
- Closed