def tree_selection_items(tree_item):
 selected = []
 for idx in range(tree_item.childCount()):
  child = tree_item.child(idx)
  if child.isSelected():
   selected.append(child)
 return selected

def tree_selection_items ( tree_item ) : selected = [ ] for idx in range ( tree_item . childCount ( ) ) : child = tree_item . child ( idx ) if child . isSelected ( ) : selected . append ( child ) return selected
returns selected widget items .