code: def updateItemIcon(self, item):
          
          # update the column width
          self.setUpdatesEnabled(False)
          colwidth = self.columnWidth(0)
          self.resizeColumnToContents(0)
          new_colwidth = self.columnWidth(0)
          
          if new_colwidth < colwidth:
              self.setColumnWidth(0, colwidth)
          self.setUpdatesEnabled(True)
docs: Updates the items icon based on its state.
          
          :param      item | <QTreeWidgetItem>