JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
jkqtpgraphsmodel.h
1/*
2 Copyright (c) 2008-2024 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
30class 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 */
40class JKQTPLOTTER_LIB_EXPORT JKQTPGraphsModel : public QAbstractTableModel
41{
42 Q_OBJECT
43public:
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 ;
50public Q_SLOTS:
52private:
54};
55
56
57#endif // jkqtpgraphsmodel_H
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
data model with all plots ina JKQTBasePlotter (+ allows to switch them visible/invisible)
Definition jkqtpgraphsmodel.h:41
int columnCount(const QModelIndex &parent=QModelIndex()) const override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
JKQTPGraphsModel(JKQTBasePlotter *parent)
Qt::ItemFlags flags(const QModelIndex &index) const override
JKQTBasePlotter * m_plotter
Definition jkqtpgraphsmodel.h:53
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89