The vast majority of application software is built to view and manipulate organized data. Even in applications that aren't explicitly database applications, there's often a need to interact with collections of data on a smaller scale, such as populating a combobox with options or displaying a hierarchy of settings. Without some sort of organizational paradigm, interactions between a GUI and a set of data can quickly become a nightmare of spaghetti code. The model-view pattern is one such paradigm.
In this chapter, we're going to learn about Qt's model-view widgets and how we can use them to work elegantly with data in our applications. We'll cover the following topics:
- Understanding model-view design
- Models and views in PyQt
- Building a comma-separated values (CSV) editor