|  | Home · All Classes · All Functions · Overviews

[Next: An Introduction to Model/View Programming]

# Model/View Programming

- An Introduction to Model/View Programming
  - The Model/View Architecture
  - Models
  - Views
  - Delegates
  - Sorting
  - Convenience Classes
  - The Model/View Components
- Using Models and Views
  - Introduction
  - Using Views with an Existing Model
- Model Classes
  - Basic Concepts
  - Model Indexes
  - Rows and Columns
  - Parents of Items
  - Item Roles
  - Summary of Concepts
  - Using Model Indexes
  - Further Reading
- Creating New Models
  - Introduction
  - Designing a Model
  - A Read-Only Example Model
  - Dimensions of The Model
  - Model Headers and Data
  - An Editable Model
  - Making the Model Editable
  - Inserting and Removing Rows
  - Next Steps
- View Classes
  - Concepts
  - Using an Existing View
  - Using a Model
  - Using Multiple Views onto the Same Model
  - Handling Selections of Items
  - Sharing Selections Between Views
- Handling Selections in Item Views
  - Concepts
  - Current Item and Selected Items
  - Using a Selection Model
  - Selecting Items
  - Reading the Selection State
  - Updating a Selection
  - Selecting All Items in a Model
- Delegate Classes
  - Concepts
  - Using an Existing Delegate
  - A Simple Delegate
  - Providing an Editor
  - Submitting Data to the Model
  - Updating the Editor's Geometry
  - Editing Hints
- Item View Convenience Classes
  - Overview
  - List Widgets
  - Tree Widgets
  - Table Widgets
  - Common Features
  - Hidden Items
  - Selections
  - Searching
- Using Drag and Drop with Item Views
  - Overview
  - Using Convenience Views
  - Using Model/View Classes
  - Enabling Drag and Drop for Items
  - Encoding Exported Data
  - Inserting Dropped Data into a Model
  - Decoding Imported Data
- Proxy Models
  - Overview
  - Using Proxy Models
  - Customizing Proxy Models
  - Custom Filtering Models
  - Custom Sorting Models
- Model Subclassing Reference
  - Introduction
  - Item Data Handling
  - Read-Only Access
  - Editable Items
  - Resizable Models
  - Lazy Population of Model Data
  - Navigation and Model Index Creation
  - Parents and Children
  - Drag and Drop Support and MIME Type Handling
  - MIME Data
  - Accepting Dropped Data
  - Convenience Views
  - Performance Optimization for Large Amounts of Data

### All Model/View Classes

These classes use the model/view design pattern in which the underlying data (in the model) is kept separate from the way the data is presented and manipulated by the user (in the view).

QAbstractItemDelegate | Used to display and edit data items from a model
QAbstractItemModel | The abstract interface for item model classes
QAbstractItemView | The basic functionality for item view classes
QAbstractListModel | Abstract model that can be subclassed to create one-dimensional list models
QAbstractProxyModel | Base class for proxy item models that can do sorting, filtering or other data processing tasks
QAbstractTableModel | Abstract model that can be subclassed to create table models
QColumnView | Model/view implementation of a column view
QDataWidgetMapper | Mapping between a section of a data model to widgets
QDirModel | Data model for the local filesystem
QFileSystemModel | Data model for the local filesystem
QHeaderView | Header row or header column for item views
QItemDelegate | Display and editing facilities for data items from a model
QItemEditorCreator | Makes it possible to create item editor creator bases without subclassing QItemEditorCreatorBase
QItemEditorCreatorBase | Abstract base class that must be subclassed when implementing new item editor creators
QItemEditorFactory | Widgets for editing item data in views and delegates
QItemSelection | Manages information about selected items in a model
QItemSelectionModel | Keeps track of a view's selected items
QItemSelectionRange | Manages information about a range of selected items in a model
QListView | List or icon view onto a model
QListWidget | Item-based list widget
QListWidgetItem | Item for use with the QListWidget item view class
QModelIndex | Used to locate data in a data model
QPersistentModelIndex | Used to locate data in a data model
QSortFilterProxyModel | Support for sorting and filtering data passed between another model and a view
QStandardItem | Item for use with the QStandardItemModel class
QStandardItemEditorCreator | The possibility to register widgets without having to subclass QItemEditorCreatorBase
QStandardItemModel | Generic model for storing custom data
QStringListModel | Model that supplies strings to views
QStyledItemDelegate | Display and editing facilities for data items from a model
QTableView | Default model/view implementation of a table view
QTableWidget | Item-based table view with a default model
QTableWidgetItem | Item for use with the QTableWidget class
QTableWidgetSelectionRange | Way to interact with selection in a model without using model indexes and a selection model
QTreeView | Default model/view implementation of a tree view
QTreeWidget | Tree view that uses a predefined tree model
QTreeWidgetItem | Item for use with the QTreeWidget convenience class
QTreeWidgetItemIterator | Way to iterate over the items in a QTreeWidget instance

### Related Examples

- Dir View
- Spin Box Delegate
- Pixelator
- Simple Tree Model
- Chart

[Next: An Introduction to Model/View Programming]