File indexing completed on 2024-05-12 15:54:50

0001 /*
0002  * SPDX-FileCopyrightText: (C) 2021 Mikel Johnson <mikel5764@gmail.com>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef IMAGETAGSMODEL_H
0008 #define IMAGETAGSMODEL_H
0009 
0010 #include <QAbstractListModel>
0011 
0012 #include "openfilemodel.h"
0013 
0014 class ImageTagsModel : public OpenFileModel
0015 {
0016     Q_OBJECT
0017     Q_PROPERTY(QString tag READ tag WRITE setTag NOTIFY tagChanged)
0018     Q_PROPERTY(QStringList tags READ tags NOTIFY tagsChanged)
0019 
0020 public:
0021     explicit ImageTagsModel(QObject *parent = nullptr);
0022 
0023     QString tag() const;
0024     void setTag(const QString &tag);
0025 
0026     QStringList tags() const;
0027 
0028 Q_SIGNALS:
0029     void tagChanged();
0030     void tagsChanged();
0031 
0032 private Q_SLOTS:
0033     void slotPopulate();
0034 
0035 private:
0036     void populateTags();
0037 
0038     QString m_tag;
0039     QStringList m_tags;
0040 };
0041 
0042 #endif // IMAGETAGSMODEL_H