Update item change signals

This commit is contained in:
Veronica Berglyd Olsen
2024-11-22 00:15:12 +01:00
parent e0b27317f3
commit ffe6cd0a65
11 changed files with 90 additions and 64 deletions
+7 -3
View File
@@ -78,6 +78,7 @@ class ProjectNode:
self._row = 0
self._cache: dict[int, T_NodeData] = {}
self._flags = NODE_FLAGS
self._count = 0
self.refresh()
self.updateCount()
return
@@ -193,7 +194,6 @@ class ProjectNode:
else:
child._row = len(self._children)
self._children.append(child)
self.updateCount()
return
def takeChild(self, pos: int) -> ProjectNode | None:
@@ -450,8 +450,12 @@ class ProjectModel(QAbstractItemModel):
for node in pruned:
if node.item.itemParent not in handles:
index = self.indexFromNode(node)
if child := self.removeChild(index.parent(), index.row()):
self.insertChild(child, target, pos)
if temp := self.removeChild(index.parent(), index.row()):
self.insertChild(temp, target, pos)
for child in reversed(node.allChildren()):
node._updateRelationships(child)
child.item.notifyToRefresh()
node.item.notifyToRefresh()
return
##