Mercurial > retraceit
annotate src/filterwidget.h @ 53:28d5a77db9fb 0.9.1
Ensure that the first row is properly set after filtering
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 18 May 2015 12:06:01 +0200 |
parents | 4e16fbd10945 |
children | 098a10fc2e83 |
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 |
28
4e16fbd10945
(issue3-5) Make the default sort order configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
25 Q_SIGNALS: |
4e16fbd10945
(issue3-5) Make the default sort order configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
26 void filterHasChanged(); |
4e16fbd10945
(issue3-5) Make the default sort order configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
27 |
4
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 protected: |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 void setupGUI(); |
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 protected slots: |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 void headersChanged(); |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 void filterChanged(); |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 private: |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 QSortFilterProxyModel *mModel; |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
38 QComboBox *mCombo; |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 QLineEdit *mEditLine; |
14
315e6988952a
Only add entries that do not start with # to filter
Andre Heinecke <andre.heinecke@intevation.de>
parents:
4
diff
changeset
|
40 /* 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
|
41 QMap<int, int> mColFilterMap; |
4
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 }; |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
43 #endif // FILTERWIDGET_H |