#ifndef TRENDTABLEMODEL_H
#define TRENDTABLEMODEL_H

#include <QAbstractTableModel>

class TrendTableModel : public QAbstractTableModel
{
    Q_OBJECT

public:
    explicit TrendTableModel(QObject *parent = nullptr);

    // Header:
    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
    bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value,
                               int role = Qt::EditRole) override;
    // Basic functionality:
    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;

    void setColumnCount(int count){m_nColumnCount = count;}

    void addData(int row,int column,QString data);
private:
    QMap<int,QString> headerDatas;
    QList<QList<QString> > m_datas;
    QList<QString> m_headers;
    int m_nColumnCount = 0;
};

#endif // TRENDTABLEMODEL_H
