2019-02-10 14:43:00 +01:00
|
|
|
#ifndef VARTABLEMODEL_H
|
|
|
|
#define VARTABLEMODEL_H
|
2019-02-10 14:32:15 +01:00
|
|
|
|
2019-02-10 14:43:00 +01:00
|
|
|
#include <QAbstractTableModel>
|
2019-03-16 20:34:09 +01:00
|
|
|
#include <QStringList>
|
2019-02-10 14:32:15 +01:00
|
|
|
|
2019-03-02 20:20:23 +01:00
|
|
|
#include "hpdata.h"
|
|
|
|
#include "abstractdata.h"
|
|
|
|
|
2019-02-10 14:43:00 +01:00
|
|
|
class varTableModel: public QAbstractTableModel
|
2019-02-10 14:32:15 +01:00
|
|
|
{
|
2019-02-10 14:43:00 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
2019-04-02 21:14:31 +02:00
|
|
|
|
2019-03-02 20:20:23 +01:00
|
|
|
private:
|
2019-04-02 21:14:31 +02:00
|
|
|
QObject * q_parent;
|
2019-03-16 20:34:09 +01:00
|
|
|
const static QStringList real_header;
|
|
|
|
const static QStringList complex_header;
|
2019-03-02 20:20:23 +01:00
|
|
|
hpCalcData * hpcalc =nullptr;
|
|
|
|
QString filename;
|
|
|
|
hp_DataType type;
|
|
|
|
AbstractData * dataobj =nullptr;
|
|
|
|
QList<QList<double>> dataarray;
|
|
|
|
void setup();
|
|
|
|
|
2019-02-10 14:32:15 +01:00
|
|
|
public:
|
2019-03-02 20:20:23 +01:00
|
|
|
varTableModel(QObject *parent = nullptr,
|
|
|
|
hpCalcData * dataStore =nullptr,
|
|
|
|
QString file = QStringLiteral(""),
|
|
|
|
hp_DataType dtype = HP_MAIN);
|
2019-04-02 21:14:31 +02:00
|
|
|
QModelIndex parent(const QModelIndex &index) const;
|
|
|
|
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
2019-02-10 14:43:00 +01: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;
|
2019-03-16 20:34:09 +01:00
|
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
2019-09-15 17:23:44 +02:00
|
|
|
~varTableModel();
|
2019-02-10 14:32:15 +01:00
|
|
|
};
|
|
|
|
|
2019-02-10 14:43:00 +01:00
|
|
|
#endif // VARTABLEMODEL_H
|