'Set the tree\'s column widths'

def set_column_widths(self, widths):

    if widths:
        widget = self.widget
        count = widget.header().count()
        if (len(widths) > count):
            widths = widths[:count]
        for (idx, value) in enumerate(widths):
            widget.setColumnWidth(idx, value)
