def get_item_children(item):
    """Return a sorted list of all the children items of 'item'."""
    children = [item.child(index) for index in range(item.childCount())]
    for child in children[:]:
        others = get_item_children(child)
        if others is not None:
            children += others
    return sorted(children, key=lambda child: child.line)
def get_item_children ( item ) : children = [ item . child ( index ) for index in range ( item . childCount ( ) ) ] for child in children [ : ] : others = get_item_children ( child ) if others is not None : children += others return sorted ( children , key = lambda child : child . line )
Return a sorted list of all the children items of 'item'.