Changeset View
Changeset View
Standalone View
Standalone View
src/tagmodel.h
Show All 29 Lines | |||||
30 | 30 | | |||
31 | public: | 31 | public: | ||
32 | explicit TagModel(QObject* parent = 0); | 32 | explicit TagModel(QObject* parent = 0); | ||
33 | 33 | | |||
34 | enum Roles { | 34 | enum Roles { | ||
35 | ColorRole = Qt::UserRole + 1 | 35 | ColorRole = Qt::UserRole + 1 | ||
36 | }; | 36 | }; | ||
37 | 37 | | |||
38 | virtual QHash<int, QByteArray> roleNames() const; | 38 | QHash<int, QByteArray> roleNames() const override; | ||
39 | virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; | 39 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; | ||
40 | virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; | 40 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||
41 | 41 | | |||
42 | signals: | 42 | signals: | ||
43 | void tagsChanged(); | 43 | void tagsChanged(); | ||
44 | void colorsChanged(); | 44 | void colorsChanged(); | ||
45 | 45 | | |||
46 | public slots: | 46 | public slots: | ||
47 | virtual bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()); | 47 | bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override; | ||
48 | 48 | | |||
49 | QStringList tags() const; | 49 | QStringList tags() const; | ||
50 | void setTags(const QStringList& tags); | 50 | void setTags(const QStringList& tags); | ||
51 | void addTag(const QString& tag); | 51 | void addTag(const QString& tag); | ||
52 | 52 | | |||
53 | /** | 53 | /** | ||
54 | * Return the colors of all the tags | 54 | * Return the colors of all the tags | ||
55 | */ | 55 | */ | ||
56 | QStringList colors() const; | 56 | QStringList colors() const; | ||
57 | 57 | | |||
58 | private: | 58 | private: | ||
59 | QStringList m_tags; | 59 | QStringList m_tags; | ||
60 | }; | 60 | }; | ||
61 | 61 | | |||
62 | #endif // TAGMODEL_H | 62 | #endif // TAGMODEL_H |