(selection)
return list(ranges(indices))
Return a list of ranges for all referenced columns contained in selection

    Parameters
    ----------
    selection : QItemSelection

    Returns
    -------
    rows : List[Tuple[int, int]]
Return a list of ranges for all referenced columns contained in selection
Return a list of ranges for all referenced columns contained in selection
def selection_columns(selection):
    # type: (QItemSelection) -> List[Tuple[int, int]]
    """
    Return a list of ranges for all referenced columns contained in selection

    Parameters
    ----------
    selection : QItemSelection

    Returns
    -------
    rows : List[Tuple[int, int]]
    """
    spans = {range(s.left(), s.right() + 1) for s in selection}
    indices = sorted(set(chain.from_iterable(spans)))
    return list(ranges(indices))
def selection_columns ( selection ) : # type: (QItemSelection) -> List[Tuple[int, int]] spans = { range ( s . left ( ) , s . right ( ) + 1 ) for s in selection } indices = sorted ( set ( chain . from_iterable ( spans ) ) ) return list ( ranges ( indices ) )