Mercurial > retraceit
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/metadataview.h Mon Mar 23 16:34:42 2015 +0100 @@ -0,0 +1,53 @@ +#ifndef METADATAVIEW_H +#define METADATAVIEW_H +/* Copyright (C) 2014 by Intevation GmbH + * + * This file is Free Software under the GNU GPL (v>=2) + * and comes with ABSOLUTELY NO WARRANTY! + * See LICENSE.txt for details. + */ +#include <QWidget> +#include <QItemSelection> + +class QTableView; +class QSortFilterProxyModel; +class QxtCsvModel; +class MetaDataView: public QWidget +{ + Q_OBJECT + +public: + MetaDataView(QWidget * parent = 0, Qt::WindowFlags f = 0); + +protected: + void setupGUI(); + +public: + /**@brief parse a metadata file and set up the model accordingly. + * + * @returns a localized error message in case of parsing errors. Or + * an empty string on success. */ + QString parseMetaData(const QString& fileName); + +Q_SIGNALS: + /**@brief emited when the selection changed. + * + * @param pictureFile: The file that is now selected. + * @param info: Additional info to show with the file.*/ + void selectionChanged(const QString& pictureFile, const QString& info); + +protected slots: + void viewSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); + +public slots: + /**@brief selects the next row and emits a selection changed signal */ + void selectNextRow(); + +protected: + QxtCsvModel *mCSVModel; + QSortFilterProxyModel *mSortModel; + QTableView *mView; +}; + + +#endif // METADATAVIEW_H