KDEUI
krecursivefilterproxymodel.h
Go to the documentation of this file.
00001 /* 00002 Copyright (c) 2009 Stephen Kelly <steveire@gmail.com> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 00021 #ifndef KRECURSIVEFILTERPROXYMODEL_H 00022 #define KRECURSIVEFILTERPROXYMODEL_H 00023 00024 #include <QtGui/QSortFilterProxyModel> 00025 00026 #include "kdeui_export.h" 00027 00028 class KRecursiveFilterProxyModelPrivate; 00029 00087 class KDEUI_EXPORT KRecursiveFilterProxyModel : public QSortFilterProxyModel 00088 { 00089 Q_OBJECT 00090 public: 00094 explicit KRecursiveFilterProxyModel(QObject* parent = 0); 00095 00099 virtual ~KRecursiveFilterProxyModel(); 00100 00102 void setSourceModel( QAbstractItemModel *model ); 00103 00107 virtual QModelIndexList match( const QModelIndex& start, int role, const QVariant& value, int hits = 1, 00108 Qt::MatchFlags flags = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const; 00109 00110 protected: 00114 virtual bool acceptRow(int sourceRow, const QModelIndex &sourceParent) const; 00115 00116 private: 00118 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; 00119 00120 protected: 00121 KRecursiveFilterProxyModelPrivate * const d_ptr; 00122 00123 private: 00124 //@cond PRIVATE 00125 Q_DECLARE_PRIVATE(KRecursiveFilterProxyModel) 00126 00127 Q_PRIVATE_SLOT(d_func(), void sourceDataChanged(const QModelIndex &source_top_left, const QModelIndex &source_bottom_right)) 00128 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeInserted(const QModelIndex &source_parent, int start, int end)) 00129 Q_PRIVATE_SLOT(d_func(), void sourceRowsInserted(const QModelIndex &source_parent, int start, int end)) 00130 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeRemoved(const QModelIndex &source_parent, int start, int end)) 00131 Q_PRIVATE_SLOT(d_func(), void sourceRowsRemoved(const QModelIndex &source_parent, int start, int end)) 00132 //@endcond 00133 }; 00134 00135 #endif 00136
KDE 4.6 API Reference