#ifndef HEADER_H
#define HEADER_H


#include <QAbstractItemModel>

class HHeaderModel : public QAbstractItemModel
{
    /*
    struct ModelData //模型数据结构
    {
        QString text;

        ModelData() : text("")
        {
        }
    };
    */

    Q_OBJECT

public:
    HHeaderModel(QObject * parent = 0);
    //~HHeaderModel();
/*
public:
    void setItem(int row, int col, const QString & text);

    QString item(int row, int col);

    void setSpan(int firstRow, int firstColumn, int rowSpanCount, int columnSpanCount);
    //const CellSpan& getSpan(int row, int column);

public:
    virtual QModelIndex index(int row, int column, const QModelIndex & parent) const override;
    virtual QModelIndex parent(const QModelIndex & child) const override;
    virtual int rowCount(const QModelIndex & parent) const override;
    virtual int columnCount(const QModelIndex & parent) const override;
    virtual QVariant data(const QModelIndex & index, int role) const override;
    virtual Qt::ItemFlags flags(const QModelIndex & index) const override;
    virtual bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) override;
    virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override;

private:
    //找到对应的模型数据
    ModelData * modelData(const QModelIndex & index) const;

private:
    //key rowNo,  key colNo
    QMap<int, QMap<int, ModelData *> > m_modelDataMap;
    int m_iMaxCol;

    //CellSpan m_InvalidCellSpan;
    //QList<CellSpan> m_cellSpanList;
    */
};

#endif // HEADER_H
