Debian Codegraph @

utils/fgqcanvas/elementdatamodel.h

raw symbols SCIP
1 //
2 // Copyright (C) 2017 James Turner [email protected]
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License as
6 // published by the Free Software Foundation; either version 2 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // 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, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 #ifndef ELEMENTDATAMODEL_H
19 #define ELEMENTDATAMODEL_H
20
21 #include <QAbstractTableModel>
22
23 class FGCanvasElement;
24
25 class ElementDataModel : public QAbstractTableModel
26 {
27 Q_OBJECT
28 public:
29 ElementDataModel(QObject* pr);
30
31 void setElement(FGCanvasElement* e);
32
33 virtual int rowCount(const QModelIndex &parent) const override;
34
35 virtual int columnCount(const QModelIndex &parent) const override;
36
37 virtual QVariant data(const QModelIndex &index, int role) const override;
38
39
40 private:
41 void computeKeys();
42
43 FGCanvasElement* m_element;
44 QList<QByteArray> m_keys;
45 };
46
47 #endif // ELEMENTDATAMODEL_H