Ok, found the solution.
The signal to be emitted is dataChanged(QModelIndex,QModelIndex)
. I thought it was emitted by the setData
function but in fact not.
Changing the changeColor
function by :
def changeColor(self, model):
model.setData(model.index(1, 5), 1)
model.setData(model.index(2, 5), 2)
model.emit(QtCore.SIGNAL('dataChanged(QModelIndex,QModelIndex)'), model.index(1, 5), model.index(2, 5))
solves the problem.