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
qspecialfilter.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 QSPECIALFILTER_H
22 #define QSPECIALFILTER_H
23 
24 #include <qaivlib_global.h>
25 #include <qabstractfilter.h>
26 
28 class QAIVLIBSHARED_EXPORT QSpecialFilter : public QAbstractFilter
29 {
30 public:
31  enum {
32  Type = 7
33  };
34  //
35  enum MatchFlag {
36  MatchFlagInvalid = -1,
37  Contains = 1,
38  ContainsNot,
39  EndsWith,
40  EndsNotWith,
41  IsBetween,
42  IsEmpty,
43  IsEqual,
44  IsGreator,
45  IsGreatorOrEqual,
46  IsLessOrEqual,
47  IsLess,
48  IsNotBetween,
49  IsNotEmpty,
50  IsNotEqual,
51  StartsWith,
52  StartsNotWith
53  };
57  QSpecialFilter(int row, int column);
61  QWidget* createEditor(QFilterViewItemDelegate* delegate, QWidget* parent, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
62 
63  void addContextMenuActions(QMenu* menu, QWidget* receiver);
69  QVariant data(int role = Qt::DisplayRole) const;
70 
71  bool matches(const QVariant & value, int type) const;
72 
73  QSpecialFilter::MatchFlag matchFlag() const;
74 
75  void setEditorData(QWidget * editor, const QModelIndex & index);
76 
77  void setModelData(QWidget* editor, QAbstractItemModel * model, const QModelIndex & index);
78 
79  void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem & option, const QModelIndex & index);
80 };
81 
82 #endif // QSPECIALFILTER_H
virtual QVariant data(int role=Qt::DisplayRole) const =0
The QAbstractFilter class provides a base class for filter definitions used with a QAdvancedTableView...
Definition: qabstractfilter.h:41
virtual QWidget * createEditor(QFilterViewItemDelegate *delegate, QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const =0
virtual void addContextMenuActions(QMenu *menu, QWidget *receiver)
Definition: qabstractfilter.cpp:90
virtual void setEditorData(QWidget *editor, const QModelIndex &index)=0
virtual bool matches(const QVariant &value, int type=-1) const =0
The QTextFilter class implements a conditonal filter.
Definition: qspecialfilter.h:28
The QFilterViewItemDelegate class provides display and editing facilities for filter from a filter mo...
Definition: qfilterviewitemdelegate.h:30