|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# QSortingProxyModel Class Reference
[QtGui module]

The QSortingProxyModel class provides support for sorting data that is passed between another model and a view. More...

    #include <QSortingProxyModel>

Inherits QMappingProxyModel.

This class was introduced in Qt 4.1.

- List of all members, including inherited members

### Public Types

- typedef Compare

### Public Functions

- QSortingProxyModel ( QObject * parent = 0 )
- ~QSortingProxyModel ()
- virtual void clear ()
- void setGreaterThan ( Compare function )
- void setLessThan ( Compare function )

- 1 public function inherited from QMappingProxyModel
- 2 public functions inherited from QAbstractProxyModel
- 32 public functions inherited from QAbstractItemModel
- 28 public functions inherited from QObject

### Additional Inherited Members

- 1 property inherited from QObject
- 2 public slots inherited from QAbstractItemModel
- 1 public slot inherited from QObject
- 12 signals inherited from QAbstractItemModel
- 1 signal inherited from QObject
- 4 static public members inherited from QObject
- 5 protected functions inherited from QMappingProxyModel
- 13 protected functions inherited from QAbstractItemModel
- 7 protected functions inherited from QObject

## Detailed Description

The QSortingProxyModel class provides support for sorting data that is passed between another model and a view.

See also QAbstractProxyModel, QAbstractItemModel, and Model/View Programming.

## Member Type Documentation

### typedef QSortingProxyModel::Compare

Defines the type of function to be used when comparing items of data from the model. Comparison functions must have a signature in the following form:

        bool(*Compare)(const QModelIndex &left, const QModelIndex &right);

## Member Function Documentation

### QSortingProxyModel::QSortingProxyModel ( QObject * parent = 0 )

Constructs a sorting proxy model with the given parent.

### QSortingProxyModel::~QSortingProxyModel ()

Destroys the sorting proxy model.

### void QSortingProxyModel::clear () `[virtual]`

Clears the sorting proxy model, removing all map.

Reimplemented from QMappingProxyModel.

### void QSortingProxyModel::setGreaterThan ( Compare function )

Sets the given function to be used as the > operator when sorting;

### void QSortingProxyModel::setLessThan ( Compare function )

Sets the given function to be used as the < operator when sorting;