summaryrefslogtreecommitdiff
path: root/tagproptablemodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'tagproptablemodel.h')
-rw-r--r--tagproptablemodel.h36
1 files changed, 36 insertions, 0 deletions
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 <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