code: def insertChild(self, childItem, position=None):
          
          if position is None:
              position = self.nChildren()
  
          assert childItem.parentItem is None, "childItem already has a parent: {}".format(childItem)
          assert childItem._model is None, "childItem already has a model: {}".format(childItem)
  
          childItem.parentItem = self
          childItem.model = self.model
          self.childItems.insert(position, childItem)
          return childItem
docs: Inserts a child item to the current item.
              The childItem must not yet have a parent (it will be set by this function).
  
              IMPORTANT: this does not let the model know that items have been added.
              Use BaseTreeModel.insertItem instead.
  
              param childItem: a BaseTreeItem that will be added
              param position: integer position before which the item will be added.
                  If position is None (default) the item will be appended at the end.
  
              Returns childItem so that calls may be chained.