14. Model/View Programming

Model/view programming is a technique that involves separating data from its visual representation. It was first popularized as the MVC (model/view/controller) paradigm used in the Smalltalk programming language.

A model is a class that provides a uniform interface through which data items can be accessed. A view is a class that can present the data items from a model to the user on-screen. A controller is a class that mediates between the user interface (e.g., mouse events and key presses) to provide a means by which users can manipulate data items.

The MVC approach offers several benefits. For example, huge datasets can be handled, ...

Get Rapid GUI Programming with Python and Qt: The Definitive Guide to PyQt Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.