(self)
Callback for table selection change; update checkboxes
Callback for table selection change; update checkboxes
Callback for table selection change ; update checkboxes
def __rows_selected(self) -> None:
        """Callback for table selection change; update checkboxes"""
        selected_attrs = self.get_selected_attributes()

        types = {type(attr) for attr in selected_attrs}
        active_aggregations = [self.aggregations[attr] for attr in selected_attrs]
        for agg, cb in self.agg_checkboxes.items():
            cb.setDisabled(not types & AGGREGATIONS[agg].types)

            activated = {agg in a for a in active_aggregations}
            with block_signals(cb):
                # check if aggregation active for all selected attributes,
                # partially check if active for some else uncheck
                cb.setCheckState(
                    Qt.Checked
                    if activated == {True}
                    else (Qt.Unchecked if activated == {False} else Qt.PartiallyChecked)
                )
def __rows_selected ( self ) -> None : selected_attrs = self . get_selected_attributes ( ) types = { type ( attr ) for attr in selected_attrs } active_aggregations = [ self . aggregations [ attr ] for attr in selected_attrs ] for agg , cb in self . agg_checkboxes . items ( ) : cb . setDisabled ( not types & AGGREGATIONS [ agg ] . types ) activated = { agg in a for a in active_aggregations } with block_signals ( cb ) : # check if aggregation active for all selected attributes, # partially check if active for some else uncheck cb . setCheckState ( Qt . Checked if activated == { True } else ( Qt . Unchecked if activated == { False } else Qt . PartiallyChecked ) )