MVC(model-view-controller): The Model is the application object, the View is its screen presentation, and the Controller defines the way the user interface reacts to user input.
Model/View: View and the controller objects are combined to become a simpler framework. This separation makes it possible to display the same data in several different views without changing the underlying data structures. To allow flexible handling of user input, we introduce the delegate which allows the way items of data are rendered and edited to be customized.
1. The model/view architecture
| | The model communicates with a source of data, providing an interface for the other components in the architecture. The nature of the communication depends on the type of data source, and the way the model is implemented. The view obtains model indexes from the model; these are references to items of data. By supplying model indexes to the model, the view can retrieve items of data from the data source. In standard views, a delegate renders the items of data. When an item is edited, the delegate communicates with the model directly using model indexes. |
Models, views, and delegates communicate with each other using signals and slots:
- Signals from the model inform the view about changes to the data held by the data source.
- Signals from the view provide information about the user's interaction with the items being displayed.
- Signals from the delegate are used during editing to tell the model and view about the state of the editor.

No comments:
Post a Comment