Chapter 13: Models and Views

A model-view design framework provides tools and techniques for separating the set of underlying data classes (the model) from the set of classes that present the user with a GUI (the view). Models typically organize the data, which can be tabular or hiearchical. In this chapter, we will show how to use the model classes in Qt to represent many different kinds of data.

In several earlier examples, you saw code that attempted to keep a clean separation between model classes that represent data and view code that presented a user interface. There are several important reasons for enforcing this separation.

First, separating model from view reduces the complexity of each. Model and view code have completely different ...

Get Introduction to Design Patterns in C++ with Qt, 2nd Edition 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.