40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#ifndef TAGPROPTABLEMODEL_H
|
|
#define TAGPROPTABLEMODEL_H
|
|
|
|
#include "sqlitebackend.h"
|
|
|
|
#include <qabstractitemmodel.h>
|
|
|
|
|
|
|
|
class TagPropTableModel : public QAbstractTableModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
TagPropTableModel(SQLiteSaveFile *backend, bool showBaseData=true);
|
|
|
|
int rowCount(const QModelIndex &parent=QModelIndex()) const override;
|
|
int columnCount(const QModelIndex &parent=QModelIndex()) const override;
|
|
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override;
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override;
|
|
|
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
|
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override;
|
|
|
|
void showTag(const Tag &tag);
|
|
|
|
QVariantMap metadata() { return tag_cached.metadata; }
|
|
|
|
private slots:
|
|
void tagChange(TagChange change, const Tag &tag);
|
|
|
|
private:
|
|
|
|
SQLiteSaveFile *backend = nullptr;
|
|
Tag tag_cached;
|
|
QStringList tag_keys;
|
|
bool showBaseData;
|
|
};
|
|
|
|
#endif // TAGPROPTABLEMODEL_H
|