diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-08-04 01:04:52 +0200 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-08-04 01:04:52 +0200 |
commit | 872bb95acf6fabd639da57cd41a4844d7e6dd0f0 (patch) | |
tree | 689d8fd95b93e2b54111fd207e93f6789c4b7f28 /taglistmodel.h | |
download | numberator-872bb95acf6fabd639da57cd41a4844d7e6dd0f0.tar.gz numberator-872bb95acf6fabd639da57cd41a4844d7e6dd0f0.tar.bz2 numberator-872bb95acf6fabd639da57cd41a4844d7e6dd0f0.zip |
Initial commit
Diffstat (limited to 'taglistmodel.h')
-rw-r--r-- | taglistmodel.h | 30 |
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
|