code: def adjust_cells(self):
          
          self.resizeColumnsToContents()
          fm = self.horizontalHeader().fontMetrics()
          names = [fm.width(s.cmd) for s in self.source_model.servers]
          if names:
              self.setColumnWidth(CMD, max(names))
          self.horizontalHeader().setStretchLastSection(True)
docs: Adjust column size based on contents.