(self, item, state)
Set the `item`s selection state to `state`.
Set the `item`s selection state to `state`.
Set the item s selection state to state .
def setItemSelected(self, item, state):
        # type: (ClusterGraphicsItem, bool) -> None
        """Set the `item`s selection state to `state`."""
        if state is False and item not in self._selection or \
                state is True and item in self._selection:
            return  # State unchanged

        if item in self._selection:
            if state is False:
                self._remove_selection(item)
                self._re_enumerate_selections()
                self.selectionChanged.emit()
        else:
            # If item is already inside another selected item,
            # remove that selection
            super_selection = self._selected_super_item(item)

            if super_selection:
                self._remove_selection(super_selection)
            # Remove selections this selection will override.
            sub_selections = self._selected_sub_items(item)

            for sub in sub_selections:
                self._remove_selection(sub)

            if state:
                self._add_selection(item)

            elif item in self._selection:
                self._remove_selection(item)

            self._re_enumerate_selections()
            self.selectionChanged.emit()
def setItemSelected ( self , item , state ) : # type: (ClusterGraphicsItem, bool) -> None if state is False and item not in self . _selection or state is True and item in self . _selection : return # State unchanged if item in self . _selection : if state is False : self . _remove_selection ( item ) self . _re_enumerate_selections ( ) self . selectionChanged . emit ( ) else : # If item is already inside another selected item, # remove that selection super_selection = self . _selected_super_item ( item ) if super_selection : self . _remove_selection ( super_selection ) # Remove selections this selection will override. sub_selections = self . _selected_sub_items ( item ) for sub in sub_selections : self . _remove_selection ( sub ) if state : self . _add_selection ( item ) elif item in self . _selection : self . _remove_selection ( item ) self . _re_enumerate_selections ( ) self . selectionChanged . emit ( )