Hello Santosh and thanks for your help,

Originally Posted by
Santosh Reddy
You should inform the first view's model to update all the views connected to it.
i actually know that... That's what i'm asking here, how can i do that? i have tried a lot of various things already... For instance:
_dtModel->setData(curIndex, sameData)
_dtModel->setData(curIndex, sameData)
To copy to clipboard, switch view to plain text mode
to force repaint...
But this solution is very bad for me, because it triggers a de-selection on the first table... How can i just "notify" as you say, that only a small portion of data has changed, and that just the redraw of one small cell has to be done?
Thanks,
Pierre.
Added after 1 19 minutes:
Ok... i finally have found the solution to my problem. In my first model, i have defined a public method as follows:
emit dataChanged(idx, idx);
}
void triggerUpdate (QModelIndex const &idx) {
emit dataChanged(idx, idx);
}
To copy to clipboard, switch view to plain text mode
Then on my main window code, where i catch changes from my 2nd model, i do that:
QModelIndex i
= ui.
tblVwDocumentTypes->selectionModel
()->currentIndex
();
QModelIndex fi
= _dtModel
->index
(i.
row(), DocumentTypesModel
::ColumnIndexStatus, i.
parent());
((DocumentTypesModel*)_dtModel)->triggerUpdate(fi);
QModelIndex i = ui.tblVwDocumentTypes->selectionModel()->currentIndex();
QModelIndex fi = _dtModel->index(i.row(), DocumentTypesModel::ColumnIndexStatus, i.parent());
((DocumentTypesModel*)_dtModel)->triggerUpdate(fi);
To copy to clipboard, switch view to plain text mode
Solved.
Pierre.
Bookmarks