CuteLogger
Fast and simple logging solution for Qt based applications
webvfxtemplatesmodel.h
1 /*
2  * Copyright (c) 2019 Meltytech, LLC
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef WEBVFXTEMPLATESMODEL_H
19 #define WEBVFXTEMPLATESMODEL_H
20 
21 #include <QAbstractListModel>
22 #include <QVariant>
23 
24 class WebvfxTemplatesModel : public QAbstractListModel
25 {
26  Q_OBJECT
27 
28 public:
29  explicit WebvfxTemplatesModel(QObject *parent = 0);
30 
31  enum Roles {
32  PathRole = Qt::UserRole + 1,
33  ProtocolRole,
34  CategoryRole
35  };
36  Q_ENUM(Roles)
37 
38  int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
39  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
40  Q_INVOKABLE QVariant data(int row, int role = Qt::DisplayRole) const;
41  QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
42  Q_INVOKABLE bool needsFolder(int row) const;
43  Q_INVOKABLE QString copyTemplate(int row, QString path) const;
44  Q_INVOKABLE QString copyTemplate(int row) const;
45 
46 private:
47  QStringList m_list;
48 };
49 
50 #endif // WEBVFXTEMPLATESMODEL_H