akonadi
krecursivefilterproxymodel.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef RECURSIVEFILTERPROXYMODEL_H
00022 #define RECURSIVEFILTERPROXYMODEL_H
00023
00024 #include <QtGui/QSortFilterProxyModel>
00025
00026 class KRecursiveFilterProxyModelPrivate;
00027
00028 class KRecursiveFilterProxyModel : public QSortFilterProxyModel
00029 {
00030 Q_OBJECT
00031 public:
00032 KRecursiveFilterProxyModel(QObject* parent = 0);
00033
00034 virtual ~KRecursiveFilterProxyModel();
00035
00036 void setSourceModel( QAbstractItemModel *model );
00037
00038 virtual QModelIndexList match(const QModelIndex& start, int role, const QVariant& value, int hits = 1,
00039 Qt::MatchFlags flags = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const;
00040
00041 protected:
00042 virtual bool acceptRow(int sourceRow, const QModelIndex &sourceParent) const;
00043
00044 private:
00045 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
00046
00047 protected:
00048 KRecursiveFilterProxyModelPrivate * const d_ptr;
00049
00050 Q_DECLARE_PRIVATE(KRecursiveFilterProxyModel)
00051
00052 Q_PRIVATE_SLOT(d_func(), void sourceDataChanged(const QModelIndex &source_top_left, const QModelIndex &source_bottom_right))
00053 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeInserted(const QModelIndex &source_parent, int start, int end))
00054 Q_PRIVATE_SLOT(d_func(), void sourceRowsInserted(const QModelIndex &source_parent, int start, int end))
00055 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeRemoved(const QModelIndex &source_parent, int start, int end))
00056 Q_PRIVATE_SLOT(d_func(), void sourceRowsRemoved(const QModelIndex &source_parent, int start, int end))
00057 };
00058
00059 #endif
00060