Mercurial > retraceit
annotate src/filterwidget.h @ 25:64a51a42c01f
Assign copyright correctly
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 05 May 2015 17:53:36 +0200 |
parents | 315e6988952a |
children | 4e16fbd10945 |
rev | line source |
---|---|
4
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
1 #ifndef FILTERWIDGET_H |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
2 #define FILTERWIDGET_H |
25
64a51a42c01f
Assign copyright correctly
Andre Heinecke <andre.heinecke@intevation.de>
parents:
14
diff
changeset
|
3 /* Copyright (C) 2015 by ETH Zürich |
64a51a42c01f
Assign copyright correctly
Andre Heinecke <andre.heinecke@intevation.de>
parents:
14
diff
changeset
|
4 * Software engineering by Intevation GmbH |
4
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 * |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 * This file is Free Software under the GNU GPL (v>=2) |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 * and comes with ABSOLUTELY NO WARRANTY! |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 * See LICENSE.txt for details. |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
9 */ |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
10 #include <QWidget> |
14
315e6988952a
Only add entries that do not start with # to filter
Andre Heinecke <andre.heinecke@intevation.de>
parents:
4
diff
changeset
|
11 #include <QMap> |
4
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
12 |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
13 class QSortFilterProxyModel; |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
14 class QComboBox; |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
15 class QLineEdit; |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
16 class FilterWidget: public QWidget |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
17 { |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
18 Q_OBJECT |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 public: |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 /**@brief construct a filterwidget for the model model.*/ |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 FilterWidget (QSortFilterProxyModel *model, |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
23 QWidget * parent = 0, Qt::WindowFlags f = 0); |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
24 |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
25 protected: |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
26 void setupGUI(); |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
27 |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 protected slots: |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 void headersChanged(); |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
30 |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
31 void filterChanged(); |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 private: |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 QSortFilterProxyModel *mModel; |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 QComboBox *mCombo; |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 QLineEdit *mEditLine; |
14
315e6988952a
Only add entries that do not start with # to filter
Andre Heinecke <andre.heinecke@intevation.de>
parents:
4
diff
changeset
|
37 /* Maps the combo index to the model col index */ |
315e6988952a
Only add entries that do not start with # to filter
Andre Heinecke <andre.heinecke@intevation.de>
parents:
4
diff
changeset
|
38 QMap<int, int> mColFilterMap; |
4
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 }; |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
40 #endif // FILTERWIDGET_H |