2
* Copyright (C) 2009 John Tapsell <tapsell@kde.org>
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Library General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Library General Public 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
16
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
* Boston, MA 02110-1301, USA.
20
#ifndef KSORTFILTERPROXYMODEL_H
21
#define KSORTFILTERPROXYMODEL_H
23
#include <QtGui/QSortFilterProxyModel>
26
* @class KSortFilterProxyModel
28
* This class extends QSortFilterProxyModel to allow filtering for a matching child
30
* It can also show all the children of a matching parent, if setShowAllChildren is set.
32
* @author John Tapsell <tapsell@kde.org>
35
class KSortFilterProxyModelPrivate;
37
class KSortFilterProxyModel
38
: public QSortFilterProxyModel
42
/*! Constructs a sorting filter model with the given parent. */
43
KSortFilterProxyModel(QObject * parent = 0);
44
/*! Destroys this sorting filter model. */
45
~KSortFilterProxyModel();
47
/*! Whether to show the children of a matching parent.
48
* This is false by default. */
49
bool showAllChildren() const;
50
/*! Set whether to show the children of a matching parent.
51
* This is false by default. */
52
void setShowAllChildren(bool showAllChildren);
56
virtual bool filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const;
57
KSortFilterProxyModelPrivate * const d_ptr;
59
Q_DISABLE_COPY( KSortFilterProxyModel )