def __init__(self, table): if not hasattr(table.model, '__getitem__'): raise TypeError('Table model must support indexed access') self._table = table self._selectionListener = addListSelectionListener( table.selectionModel, self._tableSelectionChanged) addPropertyListener(self, None, self._propertyChanged)
def __init__(self, list_): super(ListSelectionMirror, self).__init__() self._list = list_ self._selectionListener = addListSelectionListener( list.selectionModel, self._selectionChanged) addPropertyListener(self, None, self._propertyChanged)