Пример #1
0
 def __init__(self, col: Collection, state: ItemState) -> None:
     QAbstractTableModel.__init__(self)
     self.col: Collection = col
     self.columns: Dict[str, Column] = dict(
         ((c.key, c) for c in self.col.all_browser_columns()))
     gui_hooks.browser_did_fetch_columns(self.columns)
     self._state: ItemState = state
     self._items: Sequence[ItemId] = []
     self._rows: Dict[int, CellRow] = {}
     self._block_updates = False
     self._stale_cutoff = 0.0
Пример #2
0
 def __init__(
     self,
     col: Collection,
     state: ItemState,
     row_state_will_change_callback: Callable,
     row_state_changed_callback: Callable,
 ) -> None:
     QAbstractTableModel.__init__(self)
     self.col: Collection = col
     self.columns: dict[str, Column] = {
         c.key: c for c in self.col.all_browser_columns()
     }
     gui_hooks.browser_did_fetch_columns(self.columns)
     self._state: ItemState = state
     self._items: Sequence[ItemId] = []
     self._rows: dict[int, CellRow] = {}
     self._block_updates = False
     self._stale_cutoff = 0.0
     self._on_row_state_will_change = row_state_will_change_callback
     self._on_row_state_changed = row_state_changed_callback
     self._want_tooltips = aqt.mw.pm.show_browser_table_tooltips()