QtHPConnect/vartablemodel.h
2019-09-15 17:23:44 +02:00

40 lines
1.2 KiB
C++

#ifndef VARTABLEMODEL_H
#define VARTABLEMODEL_H
#include <QAbstractTableModel>
#include <QStringList>
#include "hpdata.h"
#include "abstractdata.h"
class varTableModel: public QAbstractTableModel
{
Q_OBJECT
private:
QObject * q_parent;
const static QStringList real_header;
const static QStringList complex_header;
hpCalcData * hpcalc =nullptr;
QString filename;
hp_DataType type;
AbstractData * dataobj =nullptr;
QList<QList<double>> dataarray;
void setup();
public:
varTableModel(QObject *parent = nullptr,
hpCalcData * dataStore =nullptr,
QString file = QStringLiteral(""),
hp_DataType dtype = HP_MAIN);
QModelIndex parent(const QModelIndex &index) const;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
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;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
~varTableModel();
};
#endif // VARTABLEMODEL_H