In complex user interfaces is sometimes a good idea to pull the state and behavior of the widgets out of the widgets and create and additional abstraction layer between the widgets and the domain model. This layer collects the domain data needed to display and guarantee consistence with the model underneath, without need of polluting the widgets with complex additional logic. To address this problem, the Presentation Model design pattern was born. However, the price we have to pay is adding more complexity to our application. More concretely, we need a way to keep the model, the view and the domain layer synchronized.
By leveraging from core features of Qt and QML like signals/slots and the high degree of expressiveness of declarative programing, we can apply the Presentation Model with much less pain as we’ll experience in raw C++.