36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
#ifndef TAGPROPTABLEMODEL_H
|
|
#define TAGPROPTABLEMODEL_H
|
|
|
|
#include "sqlitebackend.h"
|
|
|
|
#include <qabstractitemmodel.h>
|
|
|
|
|
|
|
|
class TagPropTableModel : public QAbstractTableModel
|
|
{
|
|
public:
|
|
TagPropTableModel(SQLiteSaveFile &backend);
|
|
TagPropTableModel(SQLiteSaveFile &backend, const Tag tag);
|
|
|
|
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);
|
|
|
|
private slots:
|
|
void tagChange(TagChange change, const Tag &tag);
|
|
|
|
private:
|
|
SQLiteSaveFile &backend;
|
|
Tag tag_cached;
|
|
QStringList tag_keys;
|
|
bool tagIsValid;
|
|
};
|
|
|
|
#endif // TAGPROPTABLEMODEL_H
|