Fixed some stuff

This commit is contained in:
2026-08-17 12:55:42 +02:00
parent cb9e03a6bf
commit 4591e6b7b0
13 changed files with 397 additions and 92 deletions

View File

@@ -131,6 +131,12 @@ class DocumentTreeModel(QAbstractItemModel):
node = index.internalPointer()
return node.value if isinstance(node, DocumentTreeNode) else None
def component_index(self, component_id: ComponentID) -> QModelIndex:
node = self._component_nodes.get(component_id)
if node is None or node.parent is None:
return QModelIndex()
return self.createIndex(node.parent.children.index(node), 0, node)
def flags(self, index: QModelIndex) -> Qt.ItemFlag:
flags = super().flags(index)