'Set whether this item is user-editable.'

def setEditable(self, editable):

    if editable:
        self.setFlags((self.flags() | QtCore.Qt.ItemIsEditable))
    else:
        self.setFlags((self.flags() & (~ QtCore.Qt.ItemIsEditable)))
