code: def takeFromTree(self):
          
          tree = self.treeWidget()
          parent = self.parent()
          
          if parent:
              parent.takeChild(parent.indexOfChild(self))
          else:
              tree.takeTopLevelItem(tree.indexOfTopLevelItem(self))
docs: Takes this item from the tree.