/* * Copyright 2008 Alex Merry * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef METADATAMODEL_H #define METADATAMODEL_H #include #include #include #include class MetadataModel : public QAbstractTableModel { Q_OBJECT public: MetadataModel(QObject* parent = 0); MetadataModel(const QVariantMap& metadata, QObject* parent = 0); int rowCount(const QModelIndex& parent = QModelIndex()) const; int columnCount(const QModelIndex& parent = QModelIndex()) const; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; public slots: void setMetadata(const QVariantMap& metadata); private: QVariantMap m_metadata; QList m_keys; }; #endif // METADATAMODEL_H