class_docstr: Subclass of QGroupBox that implements collapse handle.
      
class_docstr_tok: ["Subclass","of","QGroupBox","that","implements","collapse","handle","."]
code: def setCollapsed(self, c):
      if c == self._collapsed:
          return
  
      if c is True:
          self.collapseBtn.setPath(self.closePath)
          self.setSizePolicy(
              QtWidgets.QSizePolicy.Policy.Preferred,
              QtWidgets.QSizePolicy.Policy.Preferred,
              closing=True,
          )
      elif c is False:
          self.collapseBtn.setPath(self.openPath)
          self.setSizePolicy(self._lastSizePolicy)
      else:
          raise TypeError("Invalid argument %r; must be bool." % c)
  
      for ch in self.children():
          if (
              isinstance(ch, QtWidgets.QWidget)
              and ch is not self.collapseBtn
          ):
              ch.setVisible(not c)
  
      self._collapsed = c
      self.sigCollapseChanged.emit(c)
  
file_path: pyqtgraph/pyqtgraph/widgets/GroupBox.py
imports: from ..Qt import QtCore, QtGui, QtWidgets
  from .PathButton import PathButton
label_desc: Use image node_id 4 for calling the GroupBox obj's underlying member method code with example usage: obj.setCollapsed(c) without return types