2018-08-19 23:03:46 +08:00
|
|
|
/*
|
2019-01-12 23:01:55 +08:00
|
|
|
Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>)
|
2018-08-19 23:03:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This software is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License (LGPL) as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License (LGPL) for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License (LGPL)
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-19 00:13:18 +08:00
|
|
|
/** \file jkqtpgraphsmodel.h
|
2019-01-13 01:53:16 +08:00
|
|
|
* \ingroup jkqtpgraphsmodel
|
2018-08-19 23:03:46 +08:00
|
|
|
*/
|
|
|
|
|
2018-12-19 00:13:18 +08:00
|
|
|
#ifndef jkqtpgraphsmodel_H
|
|
|
|
#define jkqtpgraphsmodel_H
|
2018-08-19 23:03:46 +08:00
|
|
|
|
2018-11-26 03:25:44 +08:00
|
|
|
#include "jkqtplotter/jkqtpbaseplotter.h"
|
|
|
|
#include "jkqtplottertools/jkqtp_imexport.h"
|
2018-08-19 23:03:46 +08:00
|
|
|
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
class JKQTBasePlotter; // forward
|
|
|
|
/** \brief data model with all plots ina JKQTBasePlotter (+ allows to switch them visible/invisible)
|
2019-01-13 01:53:16 +08:00
|
|
|
* \ingroup jkqtpgraphsmodel
|
|
|
|
*
|
2019-01-20 17:49:29 +08:00
|
|
|
* \image html JKQTPGraphsModel.png
|
2019-01-13 01:53:16 +08:00
|
|
|
*/
|
2019-01-20 17:49:29 +08:00
|
|
|
class JKQTPGraphsModel : public QAbstractTableModel
|
2018-08-19 23:03:46 +08:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPGraphsModel(JKQTBasePlotter *parent);
|
2018-08-19 23:03:46 +08:00
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override ;
|
|
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) override;
|
|
|
|
Qt::ItemFlags flags(const QModelIndex & index) const override ;
|
|
|
|
public slots:
|
|
|
|
void plotUpdated();
|
|
|
|
private:
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTBasePlotter* m_plotter;
|
2018-08-19 23:03:46 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-12-19 00:13:18 +08:00
|
|
|
#endif // jkqtpgraphsmodel_H
|