Quote Originally Posted by waynew View Post
Hey Mole - doesn't seem right to me that the model doesn't know about the view.
What about: view->setModel(model)
and from the M/V architecture doc: "Signals from the model inform the view about changes to the data held by the data source."
What did you mean? Maybe only the view now knows about the model, but then what about that line in the doc?

I think you might just be misinterpreting the documents. The way I see it (and the way MVC is supposed to work) is that models simply inform any listeners of changes. The way this is done in Qt is that models emit signals (like void rowsInserted( const QModelIndex & parent, int start, int end) or void dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight) ) and views simply connect to those. At no point is the model aware that something is connected to it, nor does it need to know.

Models are supposed to be just that, models of some underlying data structure. The whole point of MVC is keeping the model, view and controller separate from each other.