'Create a structure of tree nodes from the given model'

def walkcreate(self, node, parent=None):

    node_obj = TreeNode(self.tree_adapter, node, parent)
    self.scene.addItem(node_obj)
    if parent:
        edge = GraphicsEdge(node1=parent, node2=node_obj)
        self.scene.addItem(edge)
        parent.graph_add_edge(edge)
    for child_inst in self.tree_adapter.children(node):
        if (child_inst is not None):
            self.walkcreate(child_inst, node_obj)
    return node_obj
