(self)
Handle selection changed.
Handle selection changed.
Handle selection changed .
def selection_changed(self):
        """Handle selection changed."""
        self.any_selected = len(self.scene().selectedItems()) > 0
        if self.any_selected:
            if self.isSelected():
                self.setOpacity(self.MAX_OPACITY)
            else:
                if self.opacity() != self.HOVER_OPACITY:
                    self.setOpacity(self.SELECTION_OPACITY)
        else:
            self.setGraphicsEffect(None)
            self.setOpacity(self.MAX_OPACITY)
def selection_changed ( self ) : self . any_selected = len ( self . scene ( ) . selectedItems ( ) ) > 0 if self . any_selected : if self . isSelected ( ) : self . setOpacity ( self . MAX_OPACITY ) else : if self . opacity ( ) != self . HOVER_OPACITY : self . setOpacity ( self . SELECTION_OPACITY ) else : self . setGraphicsEffect ( None ) self . setOpacity ( self . MAX_OPACITY )