class_docstr: Displays a legend used for describing the contents of a plot.
  
  LegendItems are most commonly created by calling :meth:`PlotItem.addLegend
  <pyqtgraph.PlotItem.addLegend>`.
  
  Note that this item should *not* be added directly to a PlotItem (via
  :meth:`PlotItem.addItem <pyqtgraph.PlotItem.addItem>`). Instead, make it a
  direct descendant of the PlotItem::
  
      legend.setParentItem(plotItem)
class_docstr_tok: ["Displays","a","legend","used","for","describing","the","contents","of","a","plot",".","LegendItems","are","most","commonly","created","by","calling",":","meth",":","`","PlotItem.addLegend","<","pyqtgraph.PlotItem.addLegend",">","`",".","Note","that","this","item","should","*","not","*","be","added","directly","to","a","PlotItem","(","via",":","meth",":","`","PlotItem.addItem","<","pyqtgraph.PlotItem.addItem",">","`",")",".","Instead",",","make","it","a","direct","descendant","of","the","PlotItem",":",":","legend.setParentItem","(","plotItem",")"]
docstr: Set the brush used to draw the legend background.
  
  Accepts the same arguments as :func:`~pyqtgraph.mkBrush`.
docstr_tok: ["Set","the","brush","used","to","draw","the","legend","background",".","Accepts","the","same","arguments","as",":","func",":","`","~pyqtgraph.mkBrush","`","."]
code: def setBrush(self, *args, **kargs):
      """Set the brush used to draw the legend background.
  
      Accepts the same arguments as :func:`~pyqtgraph.mkBrush`.
      """
      brush = fn.mkBrush(*args, **kargs)
      if self.opts["brush"] == brush:
          return
      self.opts["brush"] = brush
  
      self.update()
  
imports: import math
  from ..None import functions
  from ..icons import invisibleEye
  from ..Point import Point
  from ..Qt import QtCore, QtGui, QtWidgets
  from .BarGraphItem import BarGraphItem
  from .GraphicsWidget import GraphicsWidget
  from .GraphicsWidgetAnchor import GraphicsWidgetAnchor
  from .LabelItem import LabelItem
  from .PlotDataItem import PlotDataItem
  from .ScatterPlotItem import ScatterPlotItem, drawSymbol
label_desc: Use image node_id 8 for calling the LegendItem obj's underlying member method code with example usage: obj.setBrush() without return types