annotate src/metadataview.h @ 2:97d2c8869c39

First prototype implementation of table view and player
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 23 Mar 2015 16:34:42 +0100
parents
children 248d5d1cdb38
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
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
3 /* Copyright (C) 2014 by Intevation GmbH
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
4 *
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
5 * 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
6 * and comes with ABSOLUTELY NO WARRANTY!
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
7 * See LICENSE.txt for details.
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
8 */
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
9 #include <QWidget>
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
10 #include <QItemSelection>
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
11
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
12 class QTableView;
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
13 class QSortFilterProxyModel;
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
14 class QxtCsvModel;
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
15 class MetaDataView: public QWidget
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
16 {
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
17 Q_OBJECT
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
18
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
19 public:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
20 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
21
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
22 protected:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
23 void setupGUI();
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
24
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
25 public:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
26 /**@brief parse a metadata file and set up the model accordingly.
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
27 *
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
28 * @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
29 * an empty string on success. */
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
30 QString parseMetaData(const QString& fileName);
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_SIGNALS:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
33 /**@brief emited when the selection changed.
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 * @param pictureFile: The file that is now selected.
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
36 * @param info: Additional info to show with the file.*/
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
37 void selectionChanged(const QString& pictureFile, const QString& info);
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
38
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
39 protected slots:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
40 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
41
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
42 public slots:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
43 /**@brief selects the next row and emits a selection changed signal */
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
44 void selectNextRow();
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 protected:
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
47 QxtCsvModel *mCSVModel;
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
48 QSortFilterProxyModel *mSortModel;
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
49 QTableView *mView;
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
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 #endif // METADATAVIEW_H
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)