Changeset View
Changeset View
Standalone View
Standalone View
plugins/extensions/pykrita/plugin/PythonPluginsModel.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * This file is part of PyKrita, Krita' Python scripting plugin. | ||||
3 | * | ||||
4 | * Copyright (C) 2013 Alex Turbov <i.zaufi@gmail.com> | ||||
5 | * Copyright (C) 2014-2016 Boudewijn Rempt <boud@valdyas.org> | ||||
6 | * Copyright (C) 2017 Jouni Pentikäinen (joupent@gmail.com) | ||||
7 | * | ||||
8 | * This library is free software; you can redistribute it and/or | ||||
9 | * modify it under the terms of the GNU Library General Public | ||||
10 | * License as published by the Free Software Foundation; either | ||||
11 | * version 2 of the License, or (at your option) any later version. | ||||
12 | * | ||||
13 | * This library is distributed in the hope that it will be useful, | ||||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
16 | * Library General Public License for more details. | ||||
17 | * | ||||
18 | * You should have received a copy of the GNU Library General Public License | ||||
19 | * along with this library; see the file COPYING.LIB. If not, write to | ||||
20 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
21 | * Boston, MA 02110-1301, USA. | ||||
22 | */ | ||||
23 | | ||||
24 | #ifndef KRITA_PYTHONPLUGINSMODEL_H | ||||
25 | #define KRITA_PYTHONPLUGINSMODEL_H | ||||
26 | | ||||
27 | #include <QtCore/QAbstractTableModel> | ||||
28 | | ||||
29 | class PythonPluginManager; | ||||
30 | | ||||
31 | class PythonPluginsModel : public QAbstractTableModel | ||||
32 | { | ||||
33 | public: | ||||
34 | PythonPluginsModel(QObject *parent, PythonPluginManager *pluginManager); | ||||
35 | | ||||
36 | private: | ||||
37 | enum Column {COl_NAME, COL_COMMENT, COLUMN_COUNT}; | ||||
38 | | ||||
39 | int columnCount(const QModelIndex&) const override; | ||||
40 | int rowCount(const QModelIndex&) const override; | ||||
41 | QModelIndex index(int row, int column, const QModelIndex& parent) const override; | ||||
42 | QVariant headerData(int, Qt::Orientation, int) const override; | ||||
43 | QVariant data(const QModelIndex&, int) const override; | ||||
44 | Qt::ItemFlags flags(const QModelIndex&) const override; | ||||
45 | bool setData(const QModelIndex&, const QVariant&, int) override; | ||||
46 | | ||||
47 | private: | ||||
48 | PythonPluginManager *m_pluginManager; | ||||
49 | }; | ||||
50 | | ||||
51 | #endif //KRITA_PYTHONPLUGINSMODEL_H |