JKQTPlotter
an extensive Qt4/Qt5 Plotter framework (including a fast variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
jkqtpgraphsmodel.h
1 /*
2  Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>)
3 
4 
5 
6  This software is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License (LGPL) as published by
8  the Free Software Foundation, either version 2.1 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License (LGPL) for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License (LGPL)
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 
21 
22 #ifndef jkqtpgraphsmodel_H
23 #define jkqtpgraphsmodel_H
24 
25 #include "jkqtplotter/jkqtpbaseplotter.h"
26 #include "jkqtplotter/jkqtplotter_imexport.h"
27 
28 #include <QAbstractTableModel>
29 
30 class JKQTBasePlotter; // forward
31 /** \brief data model with all plots ina JKQTBasePlotter (+ allows to switch them visible/invisible)
32  * \ingroup jkqtpgraphsmodel
33  *
34  * This class is derived from <a href="http://doc.qt.io/qt-5/qabstracttablemodel.html">QAbstractTableModel</a> and implements a model where
35  * some properties are editable. It is designed to be used together with e.g. <a href="http://doc.qt.io/qt-5/qlistview.html">QListView</a>.
36  *
37  * \image html JKQTPgraphsModel.png
38  *
39  */
40 class JKQTPGraphsModel : public QAbstractTableModel
41 {
42  Q_OBJECT
43 public:
45  int rowCount(const QModelIndex &parent = QModelIndex()) const override ;
46  int columnCount(const QModelIndex &parent = QModelIndex()) const override;
47  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
48  bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) override;
49  Qt::ItemFlags flags(const QModelIndex & index) const override ;
50 public slots:
51  void plotUpdated();
52 private:
54 };
55 
56 
57 #endif // jkqtpgraphsmodel_H
JKQTPGraphsModel::plotUpdated
void plotUpdated()
JKQTPGraphsModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
JKQTPGraphsModel::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
JKQTPGraphsModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
JKQTPGraphsModel
data model with all plots ina JKQTBasePlotter (+ allows to switch them visible/invisible)
Definition: jkqtpgraphsmodel.h:41
JKQTPGraphsModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
JKQTPGraphsModel::JKQTPGraphsModel
JKQTPGraphsModel(JKQTBasePlotter *parent)
JKQTPGraphsModel::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
JKQTBasePlotter
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition: jkqtpbaseplotter.h:329
JKQTPGraphsModel::m_plotter
JKQTBasePlotter * m_plotter
Definition: jkqtpgraphsmodel.h:53