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

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

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

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

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