parameters: (self, li)
docstring: Change the section folding state. This function is called when a push
          button is relased. It folds the correponding unfolded section and
          unfolded the corresponding folded section. When folding occurs, the
          size and the text of the section are saved. They are reloaded when the
          section is unfolded.
  
          Args:
              li (int): section logical index
docstring_summary: Change the section folding state. This function is called when a push
          button is relased. It folds the correponding unfolded section and
          unfolded the corresponding folded section. When folding occurs, the
          size and the text of the section are saved. They are reloaded when the
          section is unfolded.
docstring_tokens: Change the section folding state . This function is called when a push button is relased . It folds the correponding unfolded section and unfolded the corresponding folded section . When folding occurs the size and the text of the section are saved . They are reloaded when the section is unfolded .
function: def changeSectionFolding(self, li):
          """
          Change the section folding state. This function is called when a push
          button is relased. It folds the correponding unfolded section and
          unfolded the corresponding folded section. When folding occurs, the
          size and the text of the section are saved. They are reloaded when the
          section is unfolded.
  
          Args:
              li (int): section logical index
          """
          if self.isSectionFolded(li):
              # set size and resize mode back
              size = self.sectionsSizes[li]
              self.resizeSection(li, size)
              self.setSectionResizeMode(li, QHeaderView.Interactive)
              # and the text
              text = self.sectionsTexts[li]
              self.model().setHeaderData(li, self.orientation(), text)
  
              self.sectionsFolded[li] = False
          else:
              # save the size, resize the minimum
              self.sectionsSizes[li] = self.sectionSize(li)
              self.resizeSection(li, self.minimumSectionSize())
              self.setSectionResizeMode(li, QHeaderView.Fixed)
              # save and hide the text
              text = self.model().headerData(li, self.orientation())
              self.sectionsTexts[li] = text
              self.model().setHeaderData(li, self.orientation(), "")
  
              self.sectionsFolded[li] = True
function_tokens: def changeSectionFolding ( self , li ) : if self . isSectionFolded ( li ) : # set size and resize mode back size = self . sectionsSizes [ li ] self . resizeSection ( li , size ) self . setSectionResizeMode ( li , QHeaderView . Interactive ) # and the text text = self . sectionsTexts [ li ] self . model ( ) . setHeaderData ( li , self . orientation ( ) , text ) self . sectionsFolded [ li ] = False else : # save the size, resize the minimum self . sectionsSizes [ li ] = self . sectionSize ( li ) self . resizeSection ( li , self . minimumSectionSize ( ) ) self . setSectionResizeMode ( li , QHeaderView . Fixed ) # save and hide the text text = self . model ( ) . headerData ( li , self . orientation ( ) ) self . sectionsTexts [ li ] = text self . model ( ) . setHeaderData ( li , self . orientation ( ) , "" ) self . sectionsFolded [ li ] = True