QAdvanced Item View  0.4
The QAIV (Qt Advanced Item Views) library provides GUI and utility classes extending the capabilities of the Qt item views.
 All Classes Functions Variables Enumerations Enumerator Properties Groups Pages
qabstractfilterproxymodel.h
1 /******************************************************************************
2 ** This file is part of qadvanceditemviews.
3 **
4 ** Copyright (c) 2011-2012 Martin Hoppe martin@2x2hoppe.de
5 **
6 ** qadvanceditemviews is free software: you can redistribute it
7 ** and/or modify it under the terms of the GNU Lesser General
8 ** Public License as published by the Free Software Foundation,
9 ** either version 3 of the License, or (at your option) any
10 ** later version.
11 **
12 ** qadvanceditemviews is distributed in the hope that it will be
13 ** useful, but WITHOUT ANY WARRANTY; without even the implied
14 ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 ** See the GNU General Public License for more details.
16 **
17 ** You should have received a copy of the GNU Lesser General Public
18 ** License along with qadvanceditemviews.
19 ** If not, see <http://www.gnu.org/licenses/>.
20 ******************************************************************************/
21 #ifndef QABSTRACTFILTERPROXYMODEL_H
22 #define QABSTRACTFILTERPROXYMODEL_H
23 
24 #include <QSortFilterProxyModel>
25 
26 #include <qaivlib_global.h>
27 
29 class QAbstractFilterProxyModelPrivate;
30 
32 class QAIVLIBSHARED_EXPORT QAbstractFilterProxyModel : public QSortFilterProxyModel
33 {
34  Q_OBJECT
35 // Q_PROPERTY(QAdvancedItemViews::FilterProxyModelMode mode READ mode WRITE setMode)
36 public:
40  QAbstractFilterProxyModel(QObject* parent = 0);
49  QAbstractFilterModel* filterModel() const;
50 
51  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
56  void setFilterModel(QAbstractFilterModel* model);
60  virtual void setSourceModel(QAbstractItemModel* sourceModel);
61 signals:
66  void resultAboutToChange();
71  void resultChanged();
75  void resultCountChanged(int filteredRows, int unfilteredRows);
76 protected:
77  void emitResultCountChanged();
78  virtual bool filterAcceptsRow( int source_row, const QModelIndex & source_parent ) const = 0;
79 private slots:
80  void updateResult();
81 private:
82  QAbstractFilterProxyModelPrivate* d;
83 };
84 
85 #endif // QABSTRACTFILTERPROXYMODEL_H
86 
The QAbstractFilterProxyModel provides an abstract base class for filter models.
Definition: qabstractfilterproxymodel.h:32
The QAbstractFilterModel class provides the abstract interface for filter model classes.
Definition: qabstractfiltermodel.h:41