Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The QSortFilterProxyModel class provides support for sorting and filtering data passed between another model and a view. More...
#include <QSortFilterProxyModel>
Inherits QAbstractProxyModel.
This class was introduced in Qt 4.1.
The QSortFilterProxyModel class provides support for sorting and filtering data passed between another model and a view.
The sorting filter model transform the structure of a source model by mapping the model indexes it supplies to new indexes, corresponding to different locations, for views to use. This approach allows a given source model to be restructured as far as views are concerned without requiring any transformations on the underlying data.
The default implementation of the filter and sorting functions use the data for the items Qt::DisplayRole compare or accept items.
The default implementation of the lessThan() function used when sorting, can handle the following data types:
See also QAbstractProxyModel, QAbstractItemModel, and Model/View Programming.
Access functions:
This property holds the column where the key used to filter the contents of the source model is read from.
Access functions:
This property holds the QRegExp used to filter the contents of the source model.
Setting this property overwrites the current caseSensitivity.
Access functions:
See also setCaseSensitivity(), setFilterWildcard(), and setFilterFixedString().
Constructs a sorting filter model with the given parent.
Destroys the sorting filter model.
Clears the sorting filter model, removing all mapping.
Returns true if the value in the item in the column indicated by the given source_column and source_parent should be included in the model. The default implementation returns true.
Returns true if the value in the item in the row indicated by the given source_row and source_parent should be included in the model. The default implementation uses filterRegExp with the data returned for the Qt::DisplayRole to determine if the row should be accepted or not.
Returns true if the value of the item referred to by the given index left is less than the value of the item referred to by the given index right, otherwise returns false. This function is used as the < operator when sorting, and handles several QVariant types:
Returns the model index in the QSortFilterProxyModel given the sourceIndex from the source model.
Reimplemented from QAbstractProxyModel.
Returns the source model index corresponding to the given proxyIndex from the sorting filter model.
Reimplemented from QAbstractProxyModel.
Sets the fixed string used to filter the contents of the source model to pattern.
See also setFilterCaseSensitivity(), setFilterRegExp(), and setFilterWildcard().
Sets the wildcard expression used to filter the contents of the source model to pattern.
See also setFilterCaseSensitivity(), setFilterRegExp(), and setFilterFixedString().
Copyright © 2005 Trolltech | Trademarks | Qt 4.1.0 |