code: def resizeAllSections(header, sectionSize):
      
      for idx in range(header.length()):
          header.resizeSection(idx, sectionSize)
docs: Sets all sections (columns or rows) of a header to the same section size.
  
          :param header: a QHeaderView
          :param sectionSize: the new size of the header section in pixels