Here are the main points:
- The view will not update itself unless the model tells it the data has changed or the user triggers a view change that forces it to refetch the data.
- The model cannot tell the view that underlying data has changed unless it knows itself
- You are changing the underlying data from outside the model and not informing the model.
The usual approach would be, as wysota points out, to put the actual data inside the model and maintain the state of the data through the model instance. You can use the setData() interface to the model, or your own methods, but whenever the model changes the data it must emit the relevant dataChanged() or related signals. When your network reply comes in you insert the new image into the model causing the model to emit dataChanged().
Bookmarks