(self)
Show or hide legends based on whether they are enabled and non-empty
Show or hide legends based on whether they are enabled and non-empty
Show or hide legends based on whether they are enabled and non - empty
def update_legend_visibility(self):
        """
        Show or hide legends based on whether they are enabled and non-empty
        """
        self.shape_legend.setVisible(
            self.show_legend and bool(self.shape_legend.items))
        self.color_legend.setVisible(
            self.show_legend and bool(self.color_legend.items))
def update_legend_visibility ( self ) : self . shape_legend . setVisible ( self . show_legend and bool ( self . shape_legend . items ) ) self . color_legend . setVisible ( self . show_legend and bool ( self . color_legend . items ) )