(self)
Clear all legend items.
Clear all legend items.
Clear all legend items .
def clear(self):
        """
        Clear all legend items.
        """
        items = list(self.items)
        self.items = []
        for sample, label in items:
            self.layout.removeItem(sample)
            self.layout.removeItem(label)
            sample.hide()
            label.hide()

        self.updateSize()
def clear ( self ) : items = list ( self . items ) self . items = [ ] for sample , label in items : self . layout . removeItem ( sample ) self . layout . removeItem ( label ) sample . hide ( ) label . hide ( ) self . updateSize ( )