Mercurial > retraceit
annotate src/metadataview.h @ 92:faece2c21229 1.1
Remove dead Drag&Drop code
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 19 Jun 2015 14:28:36 +0200 |
parents | b8c7644a9d49 |
children |
rev | line source |
---|---|
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
1 #ifndef METADATAVIEW_H |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
2 #define METADATAVIEW_H |
24
6b9b5efcd7f4
Add missing copyright header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
4
diff
changeset
|
3 /* Copyright (C) 2015 by ETH Zürich |
6b9b5efcd7f4
Add missing copyright header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
4
diff
changeset
|
4 * Software engineering by Intevation GmbH |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 * |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 * This file is Free Software under the GNU GPL (v>=2) |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 * and comes with ABSOLUTELY NO WARRANTY! |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 * See LICENSE.txt for details. |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
9 */ |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
10 |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
11 /** |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
12 * @file metadataview.h |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
13 * @brief Table view of the meta data information |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
14 */ |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
15 |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
16 #include <QWidget> |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
17 #include <QItemSelection> |
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
18 #include <QDateTime> |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 class QTableView; |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 class QSortFilterProxyModel; |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 class QxtCsvModel; |
88
3916cb3c9105
Add new FilterSort model that allows to include empty values
Andre Heinecke <andre.heinecke@intevation.de>
parents:
81
diff
changeset
|
23 class IncludeEmptySortModel; |
3916cb3c9105
Add new FilterSort model that allows to include empty values
Andre Heinecke <andre.heinecke@intevation.de>
parents:
81
diff
changeset
|
24 class FilterWidget; |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
25 |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
26 /** |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
27 * @class MetaDataView |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
28 * @brief Table view of the meta data data information. |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
29 */ |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
30 class MetaDataView: public QWidget |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
31 { |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 Q_OBJECT |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 public: |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 MetaDataView(QWidget * parent = 0, Qt::WindowFlags f = 0); |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 protected: |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
38 void setupGUI(); |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
40 public: |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
41 /** |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
42 * @brief parse a metadata file and set up the model accordingly. |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
43 * |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
44 * @returns a localized error message in case of parsing errors. Or |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
45 * an empty string on success. */ |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
46 QString parseMetaData(const QString& fileName); |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
47 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
48 Q_SIGNALS: |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
49 /** @brief emited when the selection changed. */ |
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
50 void selectionChanged(const QString& pictureFile, int current, int max, |
44
73e6b6b12412
(issue 1,2) Make the column used for the Timestamp value configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
37
diff
changeset
|
51 const QString& timestamp, int number); |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
52 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
53 protected slots: |
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
54 /** @brief internal slot to handle table view selection changes */ |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
55 void viewSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
56 |
4
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
3
diff
changeset
|
57 /** @brief the data has been changed. Could be filter. */ |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
3
diff
changeset
|
58 void dataChanged(); |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
3
diff
changeset
|
59 |
81
5923d569167b
Make Header tooltips configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
66
diff
changeset
|
60 /** @brief load the configured header tooltips */ |
5923d569167b
Make Header tooltips configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
66
diff
changeset
|
61 void setupHeaderTooltips(); |
5923d569167b
Make Header tooltips configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
66
diff
changeset
|
62 |
89
b8c7644a9d49
Add config settings to hide specific columns
Andre Heinecke <andre.heinecke@intevation.de>
parents:
88
diff
changeset
|
63 /** @brief hides the columns that are set in the config hide section */ |
b8c7644a9d49
Add config settings to hide specific columns
Andre Heinecke <andre.heinecke@intevation.de>
parents:
88
diff
changeset
|
64 void hideCols(); |
b8c7644a9d49
Add config settings to hide specific columns
Andre Heinecke <andre.heinecke@intevation.de>
parents:
88
diff
changeset
|
65 |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
66 public slots: |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
67 /** @brief selects the next row and emits a selection changed signal */ |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
68 void selectNextRow(); |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
69 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
70 /** @brief selects the previous row and emits a selection changed signal */ |
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
71 void selectPrevRow(); |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
72 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
73 /** @brief select a specific row. */ |
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
74 void selectRow(int row); |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
75 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
76 /** @brief select the first row. */ |
53
28d5a77db9fb
Ensure that the first row is properly set after filtering
Andre Heinecke <andre.heinecke@intevation.de>
parents:
44
diff
changeset
|
77 void selectFirstRow(); |
28d5a77db9fb
Ensure that the first row is properly set after filtering
Andre Heinecke <andre.heinecke@intevation.de>
parents:
44
diff
changeset
|
78 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
79 /** @brief applies the default sort order from configuration */ |
28
4e16fbd10945
(issue3-5) Make the default sort order configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
24
diff
changeset
|
80 void applyDefaultSort(); |
4e16fbd10945
(issue3-5) Make the default sort order configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
24
diff
changeset
|
81 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
82 /** @brief resizes the columns to headers content */ |
35
f10d4e035eec
(issue10) Use width of header as minimum of the column size
Andre Heinecke <andre.heinecke@intevation.de>
parents:
28
diff
changeset
|
83 void resizeColsToHeaders(); |
f10d4e035eec
(issue10) Use width of header as minimum of the column size
Andre Heinecke <andre.heinecke@intevation.de>
parents:
28
diff
changeset
|
84 |
88
3916cb3c9105
Add new FilterSort model that allows to include empty values
Andre Heinecke <andre.heinecke@intevation.de>
parents:
81
diff
changeset
|
85 private: |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
86 QxtCsvModel *mCSVModel; |
88
3916cb3c9105
Add new FilterSort model that allows to include empty values
Andre Heinecke <andre.heinecke@intevation.de>
parents:
81
diff
changeset
|
87 IncludeEmptySortModel *mSortModel; |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
88 QTableView *mView; |
44
73e6b6b12412
(issue 1,2) Make the column used for the Timestamp value configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
37
diff
changeset
|
89 int mDateColIdx; |
88
3916cb3c9105
Add new FilterSort model that allows to include empty values
Andre Heinecke <andre.heinecke@intevation.de>
parents:
81
diff
changeset
|
90 FilterWidget *mFilterWidget; |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
91 }; |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
92 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
93 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
94 #endif // METADATAVIEW_H |