summaryrefslogtreecommitdiff
path: root/taglistmodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'taglistmodel.h')
-rw-r--r--taglistmodel.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/taglistmodel.h b/taglistmodel.h
new file mode 100644
index 0000000..41fa520
--- /dev/null
+++ b/taglistmodel.h
@@ -0,0 +1,30 @@
+#ifndef TAGLISTMODEL_H
+#define TAGLISTMODEL_H
+
+#include "sqlitebackend.h"
+
+#include <qabstractitemmodel.h>
+
+class TagListModel : public QAbstractListModel
+{
+public:
+ TagListModel(SQLiteSaveFile &backend);
+
+ int rowCount(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;
+
+ Tag getTag(const QModelIndex &index) const;
+
+public slots:
+ void reloadTags();
+
+private:
+ SQLiteSaveFile &backend;
+ QList<Tag> cached_tags;
+};
+
+#endif // TAGLISTMODEL_H