def setData(self, index, value, role=QtCore.Qt.EditRole):
    if role == QtCore.Qt.EditRole:
        row = index.row()
color = QtGui.QColor(value)
if color.isValid():
    pass
Qt: метод setData в QAbstractItemModel