#ifndef TAGLISTMODEL_H #define TAGLISTMODEL_H #include "sqlitebackend.h" #include class TagListModel : public QAbstractListModel { Q_OBJECT 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; QModelIndex indexOf(const Tag &t) const; 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 cached_tags; }; #endif // TAGLISTMODEL_H