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
qfilterview.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 QFILTERVIEW_H
22 #define QFILTERVIEW_H
23 
24 #include <QTableView>
25 
26 #include <qaivlib_global.h>
27 #include <qfilterviewconnector.h>
28 
29 class QAbstractItemView;
31 class QFilterViewPrivate;
32 
34 
38 class QAIVLIBSHARED_EXPORT QFilterView : public QTableView
39 {
40  Q_OBJECT
42 
45  Q_PROPERTY(int maxVisibileFilterSets READ maxVisibileFilterSets WRITE setMaxVisibileFilterSets)
46 public:
47  QFilterView( QWidget* parent = 0 );
48  ~QFilterView();
49 
50  void connectToView(QAbstractItemView* view);
51 
52  int defaultFilterType() const;
53 
54  QFilterViewConnector* filterViewConnector() const;
55 
56  bool filterVisible() const;
57 
58  int maxVisibileFilterSets() const;
59 
60  void setAllowedFilterTypes(int types);
61 
62  void setDefaultFilterType(int type);
63 
64  void setMaxVisibileFilterSets(int rows);
65 
66  void setModel(QAbstractItemModel* model);
67 
68  void toggleFilter( const QModelIndex & index );
69 signals:
70  void calcGeometryRequested();
71  void cornerButtonClicked();
72  void focusReceived();
76  void visibilityChanged(bool visible);
77  void removeColumnFilter(int row, int column);
78 public slots:
79  void addFilter();
83  void changeColor();
84  void changeProperties();
85  void disableSelectedFilters();
86  void enableSelectedFilters();
90  void removeFilter();
94  void setFilterVisible(bool visible);
99  void toggleSelectedFilters();
100 protected:
101  void contextMenuEvent( QContextMenuEvent* event );
102  void focusInEvent(QFocusEvent* event);
103  void mousePressEvent( QMouseEvent* event );
104 private slots:
105  void hideFilter();
106  void showFilter();
107 private:
108  void updateGeometry();
109 
110  QFilterViewPrivate* d;
111 };
112 
113 #endif // QFILTERVIEW_H
The QFilterViewConnector class connects a QFilterView with a QTableView or QTreeView.
Definition: qfilterviewconnector.h:33
The QFilterView class provides a widget that is used to view and edit filter definitions.
Definition: qfilterview.h:38