> > Is it that the existing code recreates all the QT items from scratch every > time there is a redraw? And your code can add/remove a much smaller subset > of QT items because of your set operations? > > Yes, that's the difference.
> I didn't quite follow your example about expanding a node. When a node is > expanded, then the children or descendants must appear in the display. How > does that relate to the "set of links" you are using to represent the > outline structure? > > In my code, all nodes both visible and invisible are added to the tree once. Expanding and collapsing is done by the QTreeWidget and there is no need to add any node for this operation to work. Currently when user clicks in the "plus icon" in tree, Leo redraws all visible items and adds those previously invisible nodes. To allow user to expand clones separately Leo currently uses the following scheme. If a node p.v is a clone then it is expanded only if it has expanded bit set on the v-node and v.expandedPositions contains a copy of p. However, keeping copies of positions in v.expandedPositions is error prone. Some structural changes of the outline, like inserting or deleting a node make those cached positions invalid and the information about expanded/collapsed state is lost. This scheme also doesn't allow to separately expand children of clones. If you try to expand one child of a clone, then it is expanded in all other clones of its parent. In the new scheme every position has its own item in the QTreeWidget and every item keeps track of its expanded/collapsed state. I hope this clears a bit what I meant by this example. Vitalije -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/30cc48dd-da11-40d5-a3af-b17eb322eaa0%40googlegroups.com.
