2
Copyright (c) 2010 Tobias Koenig <tokoe@kde.org>
4
This library is free software; you can redistribute it and/or modify it
5
under the terms of the GNU Library General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or (at your
7
option) any later version.
9
This library is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12
License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to the
16
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
#ifndef AKONADI_TASKSFILTERPROXYMODEL_H
21
#define AKONADI_TASKSFILTERPROXYMODEL_H
23
#include <QtGui/QSortFilterProxyModel>
28
* @short A proxy model for \a EntityTreeModel based task models.
30
* This class provides a filter proxy model for an EntityTreeModel.
31
* The list of shown tasks can be limited by setting a filter pattern.
32
* Only tasks that contain this pattern as part of their data will be listed.
38
* Akonadi::TasksFilterProxyModel *filter = new Akonadi::TasksFilterProxyModel;
39
* filter->setSourceModel( model );
41
* Akonadi::EntityTreeView *view = new Akonadi::EntityTreeView;
42
* view->setModel( filter );
44
* QLineEdit *filterEdit = new QLineEdit;
45
* connect( filterEdit, SIGNAL( textChanged( const QString& ) ),
46
* filter, SLOT( setFilterString( const QString& ) ) );
50
* @author Tobias Koenig <tokoe@kde.org>
52
class TasksFilterProxyModel : public QSortFilterProxyModel
58
* Creates a new tasks filter proxy model.
60
* @param parent The parent object.
62
explicit TasksFilterProxyModel( QObject *parent = 0 );
65
* Destroys the tasks filter proxy model.
67
~TasksFilterProxyModel();
71
* Sets the @p filter that is used to filter for matching tasks.
73
void setFilterString( const QString &filter );
77
virtual bool filterAcceptsRow( int row, const QModelIndex &parent ) const;