From 872bb95acf6fabd639da57cd41a4844d7e6dd0f0 Mon Sep 17 00:00:00 2001 From: jaseg Date: Tue, 4 Aug 2020 01:04:52 +0200 Subject: Initial commit --- tagproptablemodel.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tagproptablemodel.h (limited to 'tagproptablemodel.h') diff --git a/tagproptablemodel.h b/tagproptablemodel.h new file mode 100644 index 0000000..b127f90 --- /dev/null +++ b/tagproptablemodel.h @@ -0,0 +1,36 @@ +#ifndef TAGPROPTABLEMODEL_H +#define TAGPROPTABLEMODEL_H + +#include "sqlitebackend.h" + +#include + + + +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 -- cgit