O'Reilly logo

An Introduction to Design Patterns in C++ with Qt 4 by Paul Ezust, Alan Ezust

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 17. Models and Views

The Model-View pattern describes techniques of separating the underlying data (the model) from the class that presents the user with a GUI (the view). In this chapter we will see a model for a form, and a couple of ways to view and enter data into it. Qt model and view classes are discussed, and we will see examples of lists, trees, and tables.

17.1

M-V-C: What about the Controller?

392

17.2

Dynamic Form Models

393

17.3

Qt 4 Models and Views

409

17.4

Table Models

411

17.5

Tree Models

417

In several earlier examples we saw code that maintained a clean separation between model classes that represent data and view code that presents a user interface. There are several important reasons for enforcing this separation.

First of all, separating ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required