#ifndef PARAMTABLE_H
#define PARAMTABLE_H

#include <QAbstractTableModel>
#include <QObject>
#include <QVariant>
#include <QModelIndex>
#include <Qt>
#include "projectparammodel.h"

class ParamTable : public QAbstractTableModel
{
    Q_OBJECT
public:
    explicit ParamTable(QObject *parent = nullptr);

    // Обязательные методы QAbstractTableModel
    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 = 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;

    // Методы для управления данными
    void addParam(ProjectParamModel *param);
    void removeParam(int row);
    void clear();
    ProjectParamModel* getParam(int row) const;
    QList<ProjectParamModel*> getData() const;
    void setData(const QList<ProjectParamModel*> &data);

private:
    QList<ProjectParamModel*> m_data;
};

#endif // PARAMTABLE_H
