|  | Home · Overviews · Examples |

# QProxyModel Class Reference
[com.trolltech.qt.gui module]

The `QProxyModel` class provides support for processing data passed between another model and a view. More...

This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Inherits `QAbstractItemModel`.

## Detailed Description

The `QProxyModel` class provides support for processing data passed between another model and a view.

If you want to do filtering and sorting, see `QSortFilterProxyModel`.

Proxy models provide a standard model interface that can be used to manipulate the data retrieved through an underlying model. They can be used to perform operations such as sorting and filtering on the data obtained without changing the contents of the model.

Just as with subclasses of `QAbstractItemView`, `QProxyModel` provides the `setModel` function that is used to specify the model to be acted on by the proxy. Views can be connected to either the underlying model or the proxy model with `QAbstractItemView::setModel`.

Since views rely on the information provided in model indexes to identify items of data from models, and to position these items in some visual representation, proxy models must create their own model indexes instead of supplying model indexes from their underlying models.

See also Model/View Programming and `QAbstractItemModel`.