Mercurial > retraceit
annotate src/metadataview.h @ 83:11aaa9214cfb
Add back to folder selection button
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 18 Jun 2015 18:55:00 +0200 |
parents | 5923d569167b |
children | 3916cb3c9105 |
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; |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
23 |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
24 /** |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
25 * @class MetaDataView |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
26 * @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
|
27 */ |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 class MetaDataView: public QWidget |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 { |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
30 Q_OBJECT |
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 public: |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 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
|
34 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 protected: |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 void setupGUI(); |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
38 public: |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
39 /** |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
40 * @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
|
41 * |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 * @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
|
43 * an empty string on success. */ |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
44 QString parseMetaData(const QString& fileName); |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
45 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
46 Q_SIGNALS: |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
47 /** @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
|
48 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
|
49 const QString& timestamp, int number); |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
50 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
51 protected slots: |
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
52 /** @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
|
53 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
|
54 |
4
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
3
diff
changeset
|
55 /** @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
|
56 void dataChanged(); |
e4748da7140b
Add filter functionalty to metadataview
Andre Heinecke <andre.heinecke@intevation.de>
parents:
3
diff
changeset
|
57 |
81
5923d569167b
Make Header tooltips configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
66
diff
changeset
|
58 /** @brief load the configured header tooltips */ |
5923d569167b
Make Header tooltips configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
66
diff
changeset
|
59 void setupHeaderTooltips(); |
5923d569167b
Make Header tooltips configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
66
diff
changeset
|
60 |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
61 public slots: |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
62 /** @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
|
63 void selectNextRow(); |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
64 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
65 /** @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
|
66 void selectPrevRow(); |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
67 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
68 /** @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
|
69 void selectRow(int row); |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
70 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
71 /** @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
|
72 void selectFirstRow(); |
28d5a77db9fb
Ensure that the first row is properly set after filtering
Andre Heinecke <andre.heinecke@intevation.de>
parents:
44
diff
changeset
|
73 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
74 /** @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
|
75 void applyDefaultSort(); |
4e16fbd10945
(issue3-5) Make the default sort order configurable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
24
diff
changeset
|
76 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
53
diff
changeset
|
77 /** @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
|
78 void resizeColsToHeaders(); |
f10d4e035eec
(issue10) Use width of header as minimum of the column size
Andre Heinecke <andre.heinecke@intevation.de>
parents:
28
diff
changeset
|
79 |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
80 protected: |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
81 QxtCsvModel *mCSVModel; |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
82 QSortFilterProxyModel *mSortModel; |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
83 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
|
84 int mDateColIdx; |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
85 }; |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
86 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
87 |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
88 #endif // METADATAVIEW_H |