Hi

I have a few QTableView widgets, all connected to custom QAbstractItemModel based models I created for the different tables. I'm not sure what the best way is to refresh both of them (QTableView and model connected to it) when the data change. At the moment I'm doing the following every time the data changes:

Qt Code:
  1. realMatrixModel = new MatrixRealModel(internalRealMatrix);
  2. m_ui->MatrixTable->setModel(realMatrixModel);
To copy to clipboard, switch view to plain text mode 

I'm not sure if it is optimal, but it sort of works. The problem is that the QTableView does not refresh until I click on it. I've tried repaint(), setFocus() etc. etc. but nothing thus has the same effect as clicking on the QTableView.

How can I do this?

Thanks in advance,
Jaco