code: def get_idx_rect(index_list):
      
      rows, cols = list(zip(*[(i.row(), i.column()) for i in index_list]))
      return ( min(rows), max(rows), min(cols), max(cols) )
docs: Extract the boundaries from a list of indexes