PyQt and MVC-pattern

前端 未结 3 1306
孤独总比滥情好
孤独总比滥情好 2021-01-29 22:21

I am trying to design an MVC-pattern with PyQt. I want to split all programs into 3 parts:

  1. classes abstracted from all Qt classes (model)
  2. classes providin
3条回答
  •  情歌与酒
    2021-01-29 22:31

    Here's a link to the official and detailed guide on how Qt architecture offers Model-View design to an application

    http://doc.qt.io/qt-5/model-view-programming.html

    In Qt, view and controller are combined, therefore an app can be designed using Model-View framework.

    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

提交回复
热议问题