42 #ifndef QSORTFILTERPROXYMODEL_H 43 #define QSORTFILTERPROXYMODEL_H 45 #include <QtGui/qabstractproxymodel.h> 47 #ifndef QT_NO_SORTFILTERPROXYMODEL 49 #include <QtCore/qregexp.h> 89 void setFilterRegExp(
const QRegExp ®Exp);
91 int filterKeyColumn()
const;
92 void setFilterKeyColumn(
int column);
100 bool isSortLocaleAware()
const;
101 void setSortLocaleAware(
bool on);
103 int sortColumn()
const;
106 bool dynamicSortFilter()
const;
107 void setDynamicSortFilter(
bool enable);
109 int sortRole()
const;
110 void setSortRole(
int role);
112 int filterRole()
const;
113 void setFilterRole(
int role);
116 void setFilterRegExp(
const QString &pattern);
117 void setFilterWildcard(
const QString &pattern);
118 void setFilterFixedString(
const QString &pattern);
127 void filterChanged();
128 void invalidateFilter();
131 #ifdef Q_NO_USING_KEYWORD 166 const QVariant &value,
int hits = 1,
167 Qt::MatchFlags flags =
199 #endif // QT_NO_SORTFILTERPROXYMODEL 201 #endif // QSORTFILTERPROXYMODEL_H The QVariant class acts like a union for the most common Qt data types.
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
Returns a list of indexes for the items in the column of the start index where data stored under the ...
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Handles the data supplied by a drag and drop operation that ended with the given action.
#define QT_END_NAMESPACE
This macro expands to.
QRegExp filterRegExp
the QRegExp used to filter the contents of the source model
The QRegExp class provides pattern matching using regular expressions.
virtual QItemSelection mapSelectionToSource(const QItemSelection &selection) const
Returns a source selection mapped from the specified proxySelection.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
virtual QItemSelection mapSelectionFromSource(const QItemSelection &selection) const
Returns a proxy selection mapped from the specified sourceSelection.
QVariant headerData(int section, Qt::Orientation orientation, int role) const
Reimplemented Function
virtual void setSourceModel(QAbstractItemModel *sourceModel)
Sets the given sourceModel to be processed by the proxy model.
static void clear(QVariant::Private *d)
bool dynamicSortFilter
whether the proxy model is dynamically sorted and filtered whenever the contents of the source model ...
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
void fetchMore(const QModelIndex &parent)
Reimplemented Function
bool canFetchMore(const QModelIndex &parent) const
Reimplemented Function
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const =0
Reimplement this function to return the model index in the source model that corresponds to the proxy...
The QString class provides a Unicode character string.
bool isSortLocaleAware
the local aware setting used for comparing strings when sorting
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const =0
Reimplement this function to return the model index in the proxy model that corresponds to the source...
The QObject class is the base class of all Qt objects.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)
Reimplemented Function
int filterRole
the item role that is used to query the source model's data when filtering items
QModelIndex source_parent
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool lessThan(const QChar *a, int l, const char *c)
Qt::DropActions supportedDropActions() const
Reimplemented Function
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Reimplemented Function
The QStringList class provides a list of strings.
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
On models that support this, removes count rows starting with the given row under parent parent from ...
QStringList mimeTypes() const
Reimplemented Function
static const char * data(const QByteArray &arr)
bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
QModelIndex buddy(const QModelIndex &index) const
Reimplemented Function
QSize span(const QModelIndex &index) const
Reimplemented Function
The QMimeData class provides a container for data that records information about its MIME type...
Qt::CaseSensitivity filterCaseSensitivity
the case sensitivity of the QRegExp pattern used to filter the contents of the source model ...
virtual bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex())
On models that support this, inserts count rows into the model before the given row.
The QAbstractItemModel class provides the abstract interface for item model classes.
The QAbstractProxyModel class provides a base class for proxy item models that can do sorting...
The QSortFilterProxyModel class provides support for sorting and filtering data passed between anothe...
The QItemSelection class manages information about selected items in a model.
QMimeData * mimeData(const QModelIndexList &indexes) const
Reimplemented Function
QVariant data(const QModelIndex &proxyIndex, int role=Qt::DisplayRole) const
Reimplemented Function
QObject * parent() const
Returns a pointer to the parent object.
The QModelIndex class is used to locate data in a data model.
int sortRole
the item role that is used to query the source model's data when sorting items
virtual bool insertColumns(int column, int count, const QModelIndex &parent=QModelIndex())
On models that support this, inserts count new columns into the model before the given column...
Qt::ItemFlags flags(const QModelIndex &index) const
Reimplemented Function
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
Reimplemented Function
The QSize class defines the size of a two-dimensional object using integer point precision.
#define Q_DECLARE_PRIVATE(Class)
int filterKeyColumn
the column where the key used to filter the contents of the source model is read from.
Qt::CaseSensitivity sortCaseSensitivity
the case sensitivity setting used for comparing strings when sorting
static const KeyPair *const end
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
virtual bool removeColumns(int column, int count, const QModelIndex &parent=QModelIndex())
On models that support this, removes count columns starting with the given column under parent parent...